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 |
int main()
{
map<int, double> M;
M[1] = 0.3;
M[47] = 0.8;
M[33] = 0.1;
transform(M.begin(), M.end(), ostream_iterator<int>(cout, " "),
select1st<map<int, double>::value_type>());
// The output is 1 33 47.
}
| Parameter | Description | Default |
|---|---|---|
| Pair | The function object's argument type. |
| Member | Where defined | Description |
|---|---|---|
| argument_type | Adaptable Unary Function | The type of select1st's argument: Pair |
| result_type | Adaptable Unary Function | The type of the result: Pair::first_type |
const Pair::first_type& operator()(const Pair& p) const |
Adaptable Unary Function | Function call. The return value is p.first. |
[1] Pair is not actually required to be a pair<U,V>, but merely to support the same interface as pair. In almost all cases the template parameter will be a pair, but it is occasionally useful for it to be something else. One example is a struct that has the members first, second, and third.
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.