My gripe with C++ is that it provides all these abstractions for cleaner code (iterators + advance() for ex.), but then will send you off with a big FU when dealing with edge cases/checking?! Calling advance(itr, n), where n takes itr beyond .end() is Undefined Behaviour. WHY?!
I mean, yes, I can guess it maybe has something to do with "Zero-Cost-Abstractions" and moving the burden/cost of error checking to the programmer when necessary, but for some of these, it doesn't seem to even make sense without those checks?
I'm just going to keep this thread as a list of running gripes. What's the point of having a reverse iterator if I cannot use it with other STL methods in the container? Why does vector.erase(rev_itr) not work? :(
You can follow @ffledgling.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: