Several algorithms in std::ranges
(such as count_if
, find_if
, sort
, etc.) accept both a predicate and a projection.
What are the advantages of using both, as opposed to passing just a predicate that does the projection part internally?
Several algorithms in std::ranges
(such as count_if
, find_if
, sort
, etc.) accept both a predicate and a projection.
What are the advantages of using both, as opposed to passing just a predicate that does the projection part internally?