Standard C++ Library Class Reference

type of container as the one you are constructing (or calling a member function on), or you can use a
pointer to the type of element you have in the container.
For example, if your compiler does not support member function templates you can construct a
multimap in the following two ways:
multimap<int, int, less<int>, allocator>::value_type intarray[10];
multimap<int, int, less<int>, allocator> first_map(intarry,
intarray + 10);
multimap<int, int, less<int>, allocator>
second_multimap(first_multimap.begin(), first_multimap.end());
but not this way:
multimap<long, long, less<long>, allocator>
long_multimap(first_multimap.begin(),first_multimap.end());
since the long_multimap and first_multimap are not the same type.
Also, many compilers do not support default template arguments. If your compiler is one of these you
need to always supply the Compare template argument and the Allocator template argument. For
instance you'll have to write:
multimap<int, int, less<int>, allocator>
instead of:
multimap<int, int>
See Also
allocator, Containers, Iterators, map