News for hackers. Stuff that matters.
Re:Simple Proof to the Container with Most Water Problem by lonelappde on Sunday January 05, 2020 @01:49AM (#21960072)
It's an algorithm problem, not a C++ problem. Also, iterators prevent random access. You can always get iterators from a vector if you need them. And mutability is provided for convenience and because const doesn't matter in this situation.
Re:Simple Proof to the Container with Most Water Problem by jdsully on Sunday January 05, 2020 @03:53AM (#21960375)
Perhaps your not aware of C++ random_access iterators? You can indeed do random access with iterators and this functionality is integral to many standard library algorithms.

http://www.cplusplus.com/reference/iterator/RandomAccessIter...

Re:Simple Proof to the Container with Most Water Problem by rwem on Sunday January 05, 2020 @02:44PM (#21963499)
See that’s the kind of information I want to surface in an interview: candidate thinks C++ doesn’t have random-access iteration. No hire.