An Interview with C++ Creator Bjarne Stroustrup
codeguru.com
codeguru.com
I don't understand this. Yes, "auto" is a reserved word in C... but couldn't Strostrup just have named it something else?
"A regular expression standard library component"
"Hashed containers"
"The local struct is_key is used as a template argument type. Maybe you didn't even notice, but that was not allowed in C++98."
"I declared p without explicitly mentioning the type of p. Instead, I used auto, which means "use the type of the initializer." So p is a vector<pair<string,int>>::iterator. That saves a fair bit of typing and removes the possibility of a few kinds of bugs. This is the oldest C++0x feature; I implemented it in 1983, but was forced to take it out for C compatibility reasons."
...and suddenly I'm back in 1999, writing my own version of all of these in some form or another because they aren't language/standard library features and are so bleedingly obvious I literally sat there banging my head against the desk wondering why I was wasting my time doing this. C++ is like a time machine these days -- overcome by uncountable revolutions in language, slowly plodding it's way to standard (and expected) features the rest of the world has been enjoying for decades.
http://www.oceanwave.com/technical-resources/humor/c++-hoax....
:D
(In the proper article) The first improvement he mentions, being able to end the template with >> instead of > > is of course because of potential clashes with the >> operator. This reminds me how much I despise C++ templates.
I used to read Dr Dobb's journal(?) in the late 90s and I remember this long running discussion about creating a generic pointer with templates. Every issue someone would point out the subtle faults with the previous attempt and then make a brilliant improvement... repeat ad nauseam. I don't know if they ever got one that actually worked with no bugs.
I also remember the enormous screaming matches over adding generics to Java. Fundamentally the problem was that there wasn't any way to vote no. That showed that the JCP was broken long before Apache tossed their toys out of the cot.
The late 90s was not a good decade for C++. Regardless, today I can write a general, reference-counting pointer off the cuff in about 50 lines of code and it will work for any type. I had to do exactly that for a school project where we couldn't use boost, actually :)