|
Same, although in retrospect I should have known simply because C and C++ have no concept of types at runtime (excepting RTTI) - it would be impossible to instantiate an instance of a type without type information.
Real programmers use butterflies
|
|
|
|
|
That's the big "gotcha" in templates. You're far from the only one to be caught out like that.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Right? I mean, I love them, and I actually love the fact that they don't compile until you instantiate them - sometimes - because you don't have to worry about the fact that the types you're using haven't been declared yet. I use this "feature" all the time, even though it bites me.
As is usually the case with C++, the same thing that gives me fantastic flexibility also gives me huge opportunities to blow it all up.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: the same thing that gives me fantastic flexibility also gives me huge opportunities to blow it all up
As a witch, you should know that with great Powers come great responsibilities...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Yeah well, practicing witchcraft is a bit like skateboarding. It punishes you for your mistakes.
Real programmers use butterflies
|
|
|
|
|
So write your own C++ compiler using mirrored backwards B-trees, canonical lexers and dynamically functionalized parsers so your constexpr can compile like you want it to.
There's actually lots of need for such a compiler so I'm looking forward to the article
|
|
|
|
|
I'll let you know when I have 50 spare man-years laying around.
Real programmers use butterflies
|
|
|
|
|
This is a problem I was bitten by just last week. Not as badly as you but it happened. This has happened to be several times when I've written template classes and functions : they have an issue with one type or another and my testing missed that case. That's the key that I keep overlooking : make the test cases as thorough as possible. When I've done this I don't have that kind of problem and when I don't, I often do. I don't think the language or the compiler are to blame for my assumptions.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Oh I certainly blame myself. I mean, there are number of things I could have checked out that would have stopped me.
More I'm just ranting about the swiss army knife that is C++. I can use it for just about anything but somehow i always end up cutting myself with it.
Real programmers use butterflies
|
|
|
|
|
My current favorite band to listen to while working is called, "Bowling For Soup" and they have hilarious lyrics. One of my favorite phrases in a song of theirs makes me think of C++. It is a simile that says, "like a chainsaw in need of juggling." Sometimes that's how it seems templates are to work with : juggling chainsaws.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
honey the codewitch wrote: mono1 m=color<mono1>::White;
Forgive me, but isn't this a circular reference?
I mean, doesn't this confuse the compiler as to which mono1 you're referring? The variable or the template using?
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Not at all. Anything inside angle brackets is part of a template, and is not executed at run time.
Edit: Whoops I think I misunderstood you, even though my answer is more or less correct.
Basically, there's only one mono1. It's a type alias. It's also an argument to a template function that returns an instance of whatever type was passed into it.
There's nothing circular here.
Real programmers use butterflies
|
|
|
|
|
LOL. You're right. I misread the statement. mono1 is the type, *doh*
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
#define is your friend.
(runs away snickering quietly)
Software Zen: delete this;
|
|
|
|
|
Which is the best certification that helps you to boost your career?
|
|
|
|
|
Probably none of them.
No one certification will do that: we have no idea what direction your career is supposed to be heading, and a certification is normally in a pretty narrow field - so unless your career is extremely specialized, you will probably want several.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
A "degree" comes to mind.
You can get one after three to five years of college.
Highly recommended.
After that, it's really a matter of "it depends".
If you're doing Java, a C# certificate will probably do you little good.
If you're doing Azure, you can skip the AWS certificates.
In my experience, employers ask for Microsoft, AWS, Google and Scrum certificates, so they should help you.
Make sure you get the official ones though, a Udemy certificate of completion or a W3 Schools certificate won't do you much good.
|
|
|
|
|
|
|
it's impossible to answer without more details.
anecdotal, I'm 50 and I have no certification and my career is good, and no one ever mention them.
I'd rather be phishing!
|
|
|
|
|
Same here, but then I'm and embedded developer.
|
|
|
|
|
In my experience, the only thing that I have found to boost one's career is being in the right place at the right time - on top of hard work and diligence.
But, if you want to send me $300, I can reveal many ancient and mystical secrets that will make you rich and powerful beyond your wildest dreams.
modified 5-Apr-21 9:45am.
|
|
|
|
|
If you send me your bank details (including password) I will deposit the $300 quite soon.
|
|
|
|
|
Another thing that makes me go "HMM!!!"
|
|
|
|