Anonymous user
Compare a list of strings: Difference between revisions
→{{header|C++}}: document undefined behavior
(→{{header|Kotlin}}: don't retain double negatives) |
(→{{header|C++}}: document undefined behavior) |
||
Line 575:
#include <string>
// Bug: calling operator++ on an empty collection invokes undefined behavior.
std::all_of( ++(strings.begin()), strings.end(),
[&](std::string a){ return a == strings.front(); } ) // All equal
|