Quick Q: Why doesn't std::sort accept its comparator by reference? -- StackOverflow
Quick A: By design, because function objects are expected to be nonstateful values.
Recently on SO:
Why doesn't std::sort accept comparator by reference?
The standard on
std::reference_wrapperexplains thatstd::sortnow acceptsstd::reference_wrapper, allowing one to pass a comparator by reference.Is there a reason
std::sortdidn't accept the comparator by reference in the first place?

Korban's C++11/14 feature overview book now has a Clang edition, in addition to VS2013 and GCC:
The
Spotlight on Libraries Relying on C++14