W dniu 5 marca 2010 05:02 użytkownik Jon Cruz <jon@...18...> napisał:
First question, which platforms use "# include <unordered>"? I see you removed that check outright. It had been in there because other projects included those.
AFAIK <unordered_set> / <unordered_map> is the C++0x spelling. The other existing options (in particular TR1 and Boost) should cover compiling in C++0x mode as well.
I added a different implementation of pointer hashing taken from Boost
- it uses x + (x >> 3) rather than x directly.
So what are the performance differences you're seeing with that?
This will lead to less collisions. Most memory is aligned, so the lower 2 or 3 bits of pointers are usually zero - this hash fixes that. I did not benchmark this but I guess we can trust the Boost implementors.
Regards, Krzysztof