5 ms·
Seriously. Nobody needs to think about stuff like this any more: vector< vector<int> > Who even does that?
by thrownaway2424 11y ago
Seriously. Nobody needs to think about stuff like this any more:
vector< vector<int> >
Who even does that?
- spdionis 11y agoJust curious, what should you use instead?
- svalorzen 11y agoHe'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.
- deleted 11y ago[deleted]
- scott_s 11y agovector<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.
- jzwinck 11y agoMatrix2D<int>. Removing a space from between the brackets misses the forest.
- forrestthewoods 11y agoPeople on C++03 where vector<vector<int>> is defined as operator >>. This wasn't fixed until C++11. https://en.wikipedia.org/wiki/C%2B%2B11#Right_angle_bracket https://en.wikipedia.org/wiki/C%2B%2B11#Right_angle_bracket
- static_noise 11y agoDon't use C++03 in 2016 please.
- hikarudo 11y agoExcept if the compiler for your target platform (cough TI DSP cough) supports only C++03, and never will support anything newer.
- whitegrape 11y ago> Don't use C++ in 2016 please. Fixed that for you.
- ska 11y agoNo, you really didn't. For all it's problems (some of which are being addressed in recent standard update , some not so much yet) it remains the best available tool for some domains. More's the pity.
- 1024core 11y agoSeriously. C++ seems like a layer of hacks, one upon another, each designed to "fix" things in the layers below, only to add more confusion. Maybe "D" is the answer, or Go...? I don't know. I started with C++ a long time ago, but for whatever reason, kept getting out of it (for a few years) and then every time I'd get back in, I'd be surprised at the new stuff.
- jjnoakes 11y agoNot all of us have the luxury of using the latest compilers. Or the systems we support don't even have compilers which handle anything newer than C++03. Do you think compiler support is instantaneous for all platforms on all operating systems, retroactively, when the standard is published?
- xorblurb 11y agoinstantaneous != retroactively, neither it is the same as "5 years after". And all major compiler vendors have since learned that they need to be up to date with the standard ASAP, even before official publication when it is possible. Advocating C++ < 11 is harmful to the community, given how bad it was at that time.
- GFK_of_xmaspast 11y agoPersonally I find the version with spaces easier to read, but I'm not going to get annoyed either way. Of course, it should also be std::vector<std::vector<int>> ...
- stinos 11y agoor more spacey, like std::vector< std::vector< int > >