Predicates

Back to Algorithm objects

The predicate concept is a refinement of the algorithm concept. It requires additionally that the algorithm takes two arbitrary arguments and returns a boolean result.

Example

Sorting is usually carried out something like this:

std::sort(begin, end, std::greater<int>());

With predicates we write this:

std::sort(begin, end, GreaterThan());

Learn more

Files

Predicate concept