simple C++ hash_set example

前端 未结 2 1013
旧时难觅i
旧时难觅i 2020-12-31 20:10

I am new to C++ and STL. I am stuck with the following simple example of a hash set storing custom data structures:

#include 
#include 

        
2条回答
  •  余生分开走
    2020-12-31 20:39

    You should investigate using the STL's TR1 extension namely

    • unordered_map
    • unordered_set
    • unordered_multimap
    • unordered_mutliset

    Most modern C++ compilers ship with these extensions, hence there is no need to use a non-standard class such as hash_set etc.

    • http://en.wikipedia.org/wiki/Unordered_map_%28C%2B%2B_class%29
    • http://publib.boulder.ibm.com/infocenter/comphelp/v9v111/index.jsp?topic=/com.ibm.xlcpp9.aix.doc/standlib/stl_unordered_map.htm
    • http://www.cplusplus.com/reference/unordered_set/unordered_set/

提交回复
热议问题