Skip to content

Glossary: Data Structures and Algorithms in C++

Comparator

Also written: comparators

A function (or lambda) of two items that returns true when the first should go before the second. It tells std::sort or std::stable_sort how to order structs like Sam's orders.

Where the book teaches it

Related terms

LambdaStable sort