On Fri, Jul 8, 2011 at 7:10 PM, Chris Frey <cdf...@foursquare.net> wrote: > On Thu, Jul 07, 2011 at 11:18:17PM +0200, Kai Sterker wrote: >> but it may well be triggered by our mingling of "normal" >> STL and TR1 headers. > > Are you referring to this, in base/hash_map.h? > > namespace std { using namespace tr1; } > > I suspect that's not quite safe. :-) > > I don't have gcc 4.6 handy, but I'd be curious what the results would > be if the above line was commented out, and -std=c++0x or -std=gnu++0x > was added to the command line.
I haven't found a binary gcc 4,6 package for Ubuntu 11.04, so I could not really test either. With gcc 4.5, removing the supect line and using one of the -std options didn't go well, however. So for now I just changed the defines of hash_map and hash_set to #define hash_map tr1::unordered_map #define hash_set tr1::unordered_set That way, stuff compiled with gcc 4.5 without the namespace trickery, and I hope it will help with gcc 4.6 too. All in all, this is going to get a bit messy, however. With c++0x, unordered_map and unordered_set will move to namespace std. So we'll end up with more #ifdefs in that header. OTOH, starting with gcc 4.4 (I believe), using hash_map/hash_set produces a lot of deprecation warnings and I didn't think it wise to just suppress them. Maybe the better approach would be to do something like here http://trac.wxwidgets.org/ticket/9532 But that would have to be replicated for the CMake build too, whereas the current implementation works independent from the build system used. Anyway. please give it a try, Shirish, and let me know if it fixes compilation for you. Kai _______________________________________________ Adonthell-general mailing list Adonthell-general@nongnu.org https://lists.nongnu.org/mailman/listinfo/adonthell-general