|Category: functors ||Component type: type |
Select1st is a functors that takes a single argument, a
pair , and returns the pair's first element.
Print all of a
Map<int, double> M;
M = 0.3;
M = 0.8;
M = 0.1;
transform(M.begin(), M.end(), ostream_iterator<int>(cout, " "),
Defined in the standard header functional, and in the nonstandard backward-compatibility header function.h. This function object is an SGI extension; it is not part of the C++ standard.
|Parameter ||Description ||Default |
|The function object's argument type. || |
There exist some types
V such that
Pair provides the same interface as a
Public base classes
select1st's members are defined in the AdaptableUnaryFunction requirements.
Select1st does not introduce any new members.
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