The hash_map
and hash_set
headers aren't included in the C++ standard yet, but they're available as extensions with all the compilers I've used lately.
I'm wondering how much I can rely on these in real code without sacrificing portability. I'm working on tools projects that need to run on a host of architectures and compilers, including:
I realize some of these are pretty exotic, but that's not the point. What are your experiences with STL extensions across multiple platforms and compilers? Are they ubiquitous yet? Would you use them in your project?
I would probably look for the boost equivelant and use that. At least they have some pressure from their users to be platform independent. I can't imagine what would happen if you filed a bug against GCC and Intel compilers and told them to reconcile their differences on how hash_map was implemented. At best you would be able to get them to talk to each other. Suppose you even acheived that, then you've only fixed how Intel and GCC compilers are different. Good luck getting everyone else together and solving the problem within a few years.
At least with boost you know any differences across platforms are being worked out by one organization..
EDIT The boost equivalent is apparently unordered set or unordered map. (thanks Head Geek)
NO, you would write your own if you're a large enough organization/project. That way you can tailor them to better suit your needs and address portability issues. EA did this, with their "eastl" intended to target all gaming platforms, PC, Mac, XBOX360, Wii, PS2, PS3 etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With