Hacker News new | ask | show | jobs
by mistrial9 547 days ago
> One time I tried to create a list<map<int>>, and my syntax errors caused the dead to walk among the living.

yeah coffee is a heck of a drug ;-)

1 comments

Older C++ compilers couldn't distinguish between a right-shift operator and the closing of multiple template parameter lists, but few people figured out you just had to put spaces between all those >s.
The old C++ language specification said you needed a space. C++11 changed that, saying you don't need a space.

https://stackoverflow.com/a/15785583

In 2005, I didn't know anyone who could afford a copy of the specification. My point was that many of the other C++ programmers I knew at the time assumed it wasn't possible to nestedly use type parameters, so they just avoided it. I'm sure there were probably a cryptic error message and several toxic message board communities involved, too.
I think hardly any C++ programmers look at the actual specification even today. Once in a while someone will reference the draft specification immediately prior to the actual specification (because the draft is available for free). People mostly look at sites like stack overflow and cppreference.com , via Google. I don't know what the status of that type of documentation was in 2005.
The problem is that map requires two template parameters and not just one.