Finds the first element in a list that does not lie in the range from 1 to 10.
list<int> L;
…
list<int>::iterator in_range = find_if(L.begin(), L.end(), not1(compose2 (logical_and<bool>(), bind2nd(greater_equal<int>(), 1), bind2nd(less_equal<int>(), 10))));
assert(in_range == L.end() || !(*in_range >= 1 && *in_range <= 10));
Defined in the standard header functional, and in the nonstandard backward-compatibility header function.h.
Parameter | Description |
---|---|
AdaptablePredicate | The type of the function object that this |
Adaptable Predicate
unary_function<AdaptablePredicate::argument_type, bool>
Member | Where defined | Description |
---|---|---|
argument_type | Adaptable Unary Function | The type of the argument: |
result_type | Adaptable Unary Function | The type of the result: |
bool operator()(argument_type) | Unary Function | Function call operator. |
unary_negate(const AdaptablePredicate& pred) | unary_negate | See below. |
template <class AdaptablePredicate> unary_negate<AdaptablePredicate> not1(const AdaptablePredicate& pred); | unary_negate | See below. |
These members are not defined in the Adaptable Predicate requirements, but are specific to
Member | Description |
---|---|
unary_negate(const AdaptablePredicate& pred) | The constructor. Creates a |
template <class AdaptablePredicate> unary_negate<AdaptablePredicate> not1(const AdaptablePredicate& pred); | If |
[1] Strictly speaking,
The function object overview, Adaptable Predicate, Predicate,
binary_negate<AdaptableBinaryPredicate>
Categories: functors, adaptors