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 (possibly const
) value value
, the type and value category of the expression bin_pred(*iter1, *iter2) or, respectively, bin_pred(*iter, value), must meet the BooleanTestable requirements.
In addition, evaluation of that expression is not allowed to call non-const member functions of the dereferenced iterators; syntactically, the predicate must accept const
object arguments, with the same behavior regardless of whether its arguments are const
or non-const
.
The following standard library facilities expect a BinaryPredicate which isn't a Compare type.
removes consecutive duplicate elementsstd::forward_list<T,Allocator>
) [edit] removes consecutive duplicate elements
std::list<T,Allocator>
) [edit] finds the last sequence of elements in a certain range
(deprecated in C++17)(removed in C++20)
constructs custom std::binary_negate objectThe following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 2114const
values were insufficent requirements strengthened
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4