Stable merge sort on the links; no element is copied or moved. If comp throws, the list keeps all its elements in an unspecified order and the exception propagates.
Declared in <cptr/forward_list.hpp>
template<class Compare = std::less<>>
void
sort(Compare comp = Compare());