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