Is hash_map part of the STL?

Quick question ... Is hash_map part of the STL?

+49
c ++ hashmap stl
May 6 '11 at 8:10
source share
6 answers

There is hash_map in STL , but the standard C ++ library is not .

Due to a common misconception, you might think of the C ++ standard library as “STL” or the part of your tool chain that implements the C ++ standard library as “STL implementation”. This is not true.

It is also very embarrassing that both MSVC ++ and GCC (which implement hash_map as an extension for the compiler), put it in std namespace , which is very misleading. * Sigh *

C ++ 11 introduced std::unordered_map , which is no different.

+89
May 6 '11 at 8:37 a.m.
source share
— -

Quote from Wikipedia (highlighted by me):

On the STL page:

The Standard Template Library (STL) is a software library partially included in the C ++ standard library.

... and then hash_map page

In the C ++ programming language, hash_map is the hash name of the associative container in the Template Library standard . This is provided by several developers, such as the GNU C ++ Compiler and Microsoft Visual C ++. This is not part of the C ++ Standard Library , but the C ++ Technical Report 1 contains a similar unordered_map container that will be included in the upcoming C ++ 0x standard.

So,

  • YES is part of the STL.
  • But this is NOT part of the standard library.
  • But this is supported by several very popular implementations.
+12
May 6 '11 at 8:11
source share

The problem is that there is no consistent meaning for the term STL . Is hash_map part of standard C ++? No, it is not. However, unordered_map will be part of the new C ++ standard and is a map implemented using hashing.

+7
May 6 '11 at 8:14
source share

Yes , hash_map is part of the STL . However, this is not part of the C ++ 03 standard library.

+4
May 6 '11 at 8:20
source share

hash_map is part of STL, but is not part of standard C ++ (C ++ 11). And a similar hash_map implementation with the name "std :: unordered_map" in standard C ++: http://www.cplusplus.com/reference/unordered_map/unordered_map/

Currently, GNU C ++ and MSVC ++ have implemented hash_map to extend the compiler, as well as Boost. Meanwhile, SGI has its own implementation for hash_map. See http://www.sgi.com/tech/stl/hash_map.html for more details.

+2
May 17 '14 at 6:51
source share

No ... Hash_map is not part of the STL standard.

-2
May 6 '11 at 8:13
source share



All Articles