Content deleted Content added
Replaced C style rubbish with proper intended C++ operation and simplified code. TODO: complex example for custom types. |
|||
Line 9:
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.
==
<source lang="cpp">
template<class Key,
Line 27:
; [Alloc] : a function which allocates new elements.
==
===Basic Usage===
<source lang="cpp">
#include <iostream>
#include <unordered_map>
▲#include <cstring>
▲ using namespace tr1;
int main()
{
months["january"] = 31;
months["february"] = 28;
Line 59 ⟶ 50:
months["november"] = 30;
months["december"] = 31;
return 0;
}
|