std::sortable(3cxx)

πŸ“¦
version 16-20260322 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ¦‹ NAME πŸ¦‹

okay bestie, so this is std::sortable β€” it's the [alg.req.sortable] concept, aka the concept literally named sortable. yes that's the whole name. slay.


✨ SYNOPSIS ✨

first thing's first, you gotta pull in the header, no cap:

#include <iterator>

πŸ“œ Concept definition πŸ“œ

here's the whole vibe, verbatim, don't touch it:

template<typename _Iter, typename _Rel ranges::less, typename _Proj identity>
concept std::sortable =  permutable<_Iter>
      && indirect_strict_weak_order<_Rel, projected<_Iter, _Proj>>

so yeah β€” for an iterator _Iter to be sortable, it's gotta be permutable<_Iter>, and _Rel has to be an indirect_strict_weak_order over _Iter as seen through _Proj. both. it's giving "and", not "or". πŸ’…


🌸 Detailed Description 🌸

[alg.req.sortable], concept sortable.

that's it, that's the description, the standard said "see the concept" and dipped πŸ™ˆ

lowkey the real lore is up in that definition block β€” everything this page is allowed to tell you is right there, so don't come for me asking for more, i literally cannot make stuff up ✨

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. 🫢


and that's a wrap, gorgeous πŸ’– this was libstdc++'s std::sortable(3cxx) page, generated by Doxygen straight from the source code, so if you're reading this at 3am trying to figure out why your iterator won't satisfy the concept β€” permutable AND an indirect strict weak order through your projection, both, periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from