Using unordered_map C ++ 0x

I use unordered_mapthat is included as: #include <unordered_map> and the program compiles as follows: g++ Test.cc -std=gnu++0x -o test Do I use unordered_mapfor TR1 or for C ++ 0x. Or is it the same thing?

+5
source share
3 answers

I believe gcc puts the TR1 headers in <tr1/unordered_map>, so you should get the C ++ 11 version. But they are very similar.

+6
source

GCC has tr1 headers in the tr1 subdirectory. In addition, there is a tr1 namespace.

#include <tr1/unordered_map>
...
std::tr1::unordered_map<...>(...);

So, if you haven’t done these things specifically or made such a β€œuse,” you have std.

, . (initializer_list, ops), .

+3

. , GCC 4.4 -std=c++0x , tr1_impl/unordered_map, GCC 4.6 , tr1/unordered_map.h bits/unordered_map.h - .../hashtable.h ; ++ 0x std::forward ..

: .

0

All Articles