[#bsl-list-054-sort-08] = xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::sort :relfileprefix: ../../ :mrdocs: `sort` overloads == Synopses Declared in `<bslstl_list.h>` Sort this list in non‐decreasing order according to the order provided by `operator<`. `operator<` must provide a strict weak ordering over `value_type` (see []and Strict Weak Ordering)). The sort is stable, meaning that if `!(a < b) && !(b < a)`, then the ordering of elements `a` and `b` in the sequence is preserved. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/list-054/sort-05.adoc[sort](); ---- [.small]#xref:bsl/list-054/sort-05.adoc[_» more..._]# Sort this list in non‐decreasing order according to the order provided by the specified `comparator` predicate. `comparator` must define a strict weak ordering over `value_type` (see []and Strict Weak Ordering)). The sort is stable, meaning that if `!comparator(a, b) && !comparator(b, a)`, then the ordering of elements `a` and `b` in the sequence is preserved. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class COMPARE> void xref:bsl/list-054/sort-0a.adoc[sort](COMPARE comparator); ---- [.small]#xref:bsl/list-054/sort-0a.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#