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
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to