help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash_map include, how?


From: Bernd Strieder
Subject: Re: hash_map include, how?
Date: Wed, 02 Aug 2006 16:57:22 +0200
User-agent: KNode/0.10.1

Hello,

Paulo Matos wrote:

> What's the correct way to include hash_map? Through #include
> <ext/hash_map>?
> Why shouldn't  work? Because it is an STL extension
> by SGI (afaik)?

hash_map is a deliberate extension provided by libstdc++. The correct
way will be #include <hash_map> after C++0x is out. If #include
<hash_map> would be used now, but in C++0x substantial changes would
have to be done, this would be very annoying. By moving it to ext/ both
versions could exist for a smooth transition. Compare to the iostream.h
to iostream transition on the introduction of namespaces.

I think hash_map has been included in TR1 for C++0x, so #include
<tr1/hash_map> could have its merits, too. But TR1 is only a temporary
story. So code using it would have its disposal time already set.

If you use hash_map now, your code will be depending on non-portable
non-standard extensions, that might be changing without notice between
compiler releases, if you prefer the worst-case to deal with.

Bernd Strieder


reply via email to

[Prev in Thread] Current Thread [Next in Thread]