hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.5K
active users

Šimon Tóth

Standard C++ containers provide lexicographical comparison through the standard set of comparison operators (before C++20) and the three-way comparison operator (since C++20).

The support covers std::array, std::vector, std::deque, std::(forward_)list, std::string (and variants), std::(multi)set, std::(multi)map, std::stack and std::queue.

Compiler Explorer link: compiler-explorer.com/z/Tar5TT

@simontoth I never know you can do that for containers other than std::string! 😯 And I used std::lexicographical_compare and friends for this purpose before

@lesley Yeah, it's not a super obvious feature.

One thing I love about doing these daily bites, I get to properly explore the weird corners of the language.