Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just curious, what should you use instead?


  vector<vector<int>>
Prior to C++11, the code above would fail to compile. The lexer would see the final ">>" and assume it was the out-stream operator. This was such an annoying issue that they eventually changed the grammar so that the above would compile as expected.


He's talking about the fact that older compilers used to get confused if you happened to open/close multiple template tags in sequence; i.e. "<<" or ">>". These were mistaken for operators, and the code failed to compile. Nowadays there's no need to keep them separated, and compilers parse them correctly.


Matrix2D<int>. Removing a space from between the brackets misses the forest.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: