Professional Documents
Culture Documents
STL Utilities
STL Utilities
Overview
The STL <utility> header contains a small number of templates that are used throughout the STL. In
the pair<KType, VType> template struct, which is essential when using maps and multimaps, but also fin
everyday programming, whenever it is useful to treat two values as a single unit. Also defined in this hea
ops, which is nested within namespace std and in turn defines the other relational operators in terms of
And here is the prototype of the useful generic function make_pair() for creating pairs:
template<class KType, class VType>
pair<KType, VType> make_pair(const KType& k, const VType& v);
give the same end result, but the first is shorter, and, one could argue, clearer than the second.
http://cs.smu.ca/~porter/csc/ref/stl/utilities.html 9/23/2010