IRIX 6.5 » Books » Developer »
Standard Template Library Programmer's Guide
(document number: 007-3426-004 / published: 1999-05-21)
table of contents | additional info | download
find in page
| Category: functors | Component type: type |
list<int> L;
...
list<int>::iterator in_range =
find_if(L.begin(), L.end(),
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 |
|---|---|---|
| T | The type of logical_and's arguments |
| Member | Where defined | Description |
|---|---|---|
| first_argument_type | Adaptable Binary Function | The type of the first argument: T |
| second_argument_type | Adaptable Binary Function | The type of the second argument: T |
| result_type | Adaptable Binary Function | The type of the result: bool |
| bool operator()(const T& x, const T& y) const | Binary Function | Function call operator. The return value is x && y. |
| logical_and() | Default Constructible | The default constructor. |
[1] Logical_and and logical_or are not very useful by themselves. They are mainly useful because, when combined with the function object adaptor binary_compose, they perform logical operations on other function objects.
Standard Template Library Programmer's Guide
(document number: 007-3426-004 / published: 1999-05-21)
table of contents | additional info | download
Copyright © 1993-2007 SGI, Inc. All rights reserved.