Boost logo

Boost :

Subject: Re: [boost] [config] gcc and <unordered_set> vs <ext/hash_set>
From: Robert Ramey (ramey_at_[hidden])
Date: 2008-12-16 15:50:28


John Maddock wrote:
> Folks, Dave A. asked for a config macro to detect the presence of std
> conforming <unordered_set> and <unordered_map>.
>
> However, I've run into an unexpected issue: it appears that with
> gcc-4.3.x you cannot include both <unordered_set> and <ext/hash_set>
> as attempting to do so leads to endless errors inside the <ext/*>
> headers :-(
> Including either one of the headers is just fine though.
>
> So... how should we handled this? Not define BOOST_HAS_HASH when
> <unordered_set> *is* available?

That would make it impossible to read archives which contain hashed
pointers under the current system. And of course one couldn't write
portable programs which use the old hashed containers any more and
not all compilers /libraries support ext/hash so the final result would be
that one couldn't make a portable program with hashed containers.

> As far as I can tell the only library effected by this change would be
> Boost.Serialization which would lose has_set support in gcc's c++0x
> mode. How do folks feel about that?

Seems to me the best would be not to include both headers in the same
source module. That is, ignore the problem and just take the
error message as a long winded version of "don't do this!!!!". Of
course a short winded version would be better and maybe
config can be ehanced to do that.

Robert Ramey

>
> Regards, John.
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk