Categories: functors, adaptors | Component type: type |
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));
Parameter | Description | Default |
---|---|---|
AdaptablePredicate | The type of the function object that this unary_negate is the logical negation of. |
Member | Where defined | Description |
---|---|---|
argument_type | Adaptable Unary Function | The type of the argument: AdaptablePredicate::argument_type |
result_type | Adaptable Unary Function | The type of the result: bool |
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. |
Member | Description |
---|---|
unary_negate(const AdaptablePredicate& pred) |
The constructor. Creates a unary_negate<AdaptablePredicate> whose underlying predicate is pred. |
template <class AdaptablePredicate> unary_negate<AdaptablePredicate> not1(const AdaptablePredicate& pred); |
If p is of type AdaptablePredicate then not1(p) is equivalent to unary_negate<AdaptablePredicate>(p), but more convenient. This is a global function, not a member function. |
[1] Strictly speaking, unary_negate is redundant. It can be constructed using the function object logical_not and the adaptor unary_compose.
Contact Us | Site Map | Trademarks | Privacy | Using this site means you accept its Terms of Use |
Copyright © 1993-2006 Silicon Graphics, Inc. All rights reserved. |