Namespaces
Variants
Views
Actions

C++ concepts: BinaryPredicate

From cppreference.com
< cpp‎ | concept
Revision as of 21:10, 3 March 2014 by Cubbi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

[edit] Requirements

[edit] Standard library

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

removes consecutive duplicate elements
(public member function of std::forward_list) [edit]
removes consecutive duplicate elements
(public member function of std::list) [edit]
finds the last sequence of elements in a certain range
(function template) [edit]
searches for any one of a set of elements
(function template) [edit]
finds the first two adjacent items that are equal (or satisfy a given predicate)
(function template) [edit]
finds the first position where two ranges differ
(function template) [edit]
determines if two sets of elements are the same
(function template) [edit]
determines if a sequence is a permutation of another sequence
(function template) [edit]
searches for a range of elements
(function template) [edit]
searches for a number consecutive copies of an element in a range
(function template) [edit]
removes consecutive duplicate elements in a range
(function template) [edit]
creates a copy of some range of elements that contains no consecutive duplicates
(function template) [edit]
constructs custom std::binary_negate object
(function template) [edit]
(since C++11)
collection of unique keys, hashed by keys
(class template) [edit]
(since C++11)
collection of key-value pairs, hashed by keys, keys are unique
(class template) [edit]
(since C++11)
collection of keys, hashed by keys
(class template) [edit]
(since C++11)
collection of key-value pairs, hashed by keys
(class template) [edit]