Unordered associative containers (C++): Difference between revisions

Content deleted Content added
ThomasTC (talk | contribs)
C++0x is done!
m grammar
Line 5:
It is similar to the <code>[[map (C++ container)|map]]</code> class in the [[C++ Standard Library|C++ standard library]] but has different constraints. As its name implies, unlike the <code>map</code> class, the elements of an <code>unordered_map</code> are not [[well ordering|ordered]]. This is due to the use of hashing to store objects. <code>unordered_map</code> can still be [[iterator|iterated]] through like a regular map.
 
In the TR1, <code>unordered_map</code> is available from the <code><tr1/unordered_map></code> [[header file]] as <code>std::tr1::unordered_map</code>. In the upcoming C++0x standard it is available from the <code><unordered_map></code> header file as <code>std::unordered_map</code>. An implementation is also available in the [[Boost C++ Libraries]] as <code><boost/unordered_map.hpp></code><ref>{{cite web |publisher=Boost |title=Class template unordered_map |url=http://www.boost.org/doc/libs/1_45_0/doc/html/boost/unordered_map.html |accessdate=26 January 2011}}</ref>.
 
It is closely related to <code>[[unordered_multimap]]</code> (available in the same header file), which is an implementation of [[multimap]] using hashing. It is also similar to <code>[[unordered_set]]</code> and <code>[[unordered_multiset]]</code>, implementations of the [[set (computer science)|set]] and [[multiset]] containers respectively and available in the <code><tr1/unordered_set></code> or <code><unordered_set></code> headers.