std::sortable(3cxx)
π¦ 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
- ubuntu resolute: libstdc++-13-doc 13.4.0-10ubuntu1
- ubuntu resolute: libstdc++-16-doc 16-20260322-1ubuntu1
- ubuntu stonking: libstdc++-13-doc 13.5.0-1ubuntu1
- ubuntu stonking: libstdc++-16-doc 16.2.0-3ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms