Untied version of hash_map / unordered_map

I am writing an embedded application, and the environment used, unfortunately, does not currently support C ++ 11.

I need to implement a hash / unordered map (a regular std::map will not do it for performance reasons), but cannot find a way to do this cleanly.

Boost does not want to work without involving almost the entire library. Even the original STI hash_map from SGI wants multiple headers and duplicates standard library functionality, causing ambiguous function calls. This is a real mess.

For ease of implementation, version control, quality control, V & V, etc. I really need something that uses the existing standard library and exists only in a few header files that I can place directly in the same folder as all other source / header files. Is there such a thing, or am I without hope? I searched for a long time, but came empty-handed.

Thanks so much for any help. If necessary, I can, of course, clarify.

+7
source share
1 answer

Have you looked at the GNU implementation? On my machine, Ubuntu unordered_map.h does not contain anything. This file is located in

  /usr/include/c++/4.6/bits/unordered_map.h 

which is about 400 lines, although the "unordered_map" file in / usr / include / c ++ / 4.6 / has more headers, but you can customize the ones I assume.

I think you can find the source code to implement with GNU.org (?) And compile it yourself?

+1
source

All Articles