[#bsl-list-054-sort-0a] = xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::sort :relfileprefix: ../../ :mrdocs: Sort this list in non‐decreasing order using the specified `comparator`. == Synopsis Declared in `<bslstl_list.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class COMPARE> void sort(COMPARE comparator); ---- == Description `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. == Parameters [cols="1,4"] |=== | Name| Description | *comparator* | binary predicate defining the sort order |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#