3 ms·
Most STL implementations catch the two errors you gave in debug mode (switching begin and end, using two different containers, etc.), and many more! As for the
by shin_lao 16y ago
Most STL implementations catch the two errors you gave in debug mode (switching begin and end, using two different containers, etc.), and many more!
As for the compiler giving crazy errors, it's true for g++ mainly. VC10 and most of all clang give intelligible messages.
- beagle3 16y agoI haven't been following STL implementations recently, but that definitely wasn't the situation even in 2007 (Over 10 years after STL was finalized..); In fact, the only implementation that it did back then was STLPort, at a huge performance hit, and only at runtime. And what you say about compilers is EXACTLY why I wrote the "latest and greatest". It's only recent clangs that can give intelligible messages for C++ (if at all) because Clang C++ support is not even ready for production yet. VC++ 2005 (last I used) did not get give reasonable errors.