Namespaces
Variants
Views
Actions

C++ concepts: BinaryPredicate

From cppreference.com
< cpp‎ | concept
Revision as of 11:56, 22 December 2012 by Bazzy (Talk | contribs)

 
 
 

The concept BinaryPredicate is a set of requirements expected by some of the standard library facilities from the user-provided arguments.

Given a BinaryPredicate bin_pred and a pair of iterators iter1 and iter2 or an iterator iter and a value value, the expression bin_pred(*iter1, *iter2) or, respectively, bin_pred(*iter, value), must be contextually convertible to bool.

In addition, evaluation of that expression is not allowed to call non-const member functions of the dereferenced iterators.

Requirements

Standard library

The following standard library facilities expect a BinaryPredicate which isn't a Compare type.

Template:cpp/container/dcl list uniqueTemplate:cpp/container/dcl list uniqueTemplate:cpp/algorithm/dcl list find endTemplate:cpp/algorithm/dcl list find first ofTemplate:cpp/algorithm/dcl list adjacent findTemplate:cpp/algorithm/dcl list mismatchTemplate:cpp/algorithm/dcl list equalTemplate:cpp/algorithm/dcl list is permutationTemplate:cpp/algorithm/dcl list searchTemplate:cpp/algorithm/dcl list search nTemplate:cpp/algorithm/dcl list uniqueTemplate:cpp/algorithm/dcl list unique copyTemplate:cpp/container/dcl list unordered setTemplate:cpp/container/dcl list unordered mapTemplate:cpp/container/dcl list unordered multisetTemplate:cpp/container/dcl list unordered multimap
constructs custom std::binary_negate object
(function template) [edit]