Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple keys Hash Table (unordered_map)

I need to use multiple keys(int type) to store and retrieve a single value from a hash table. I would use multiple key to index a single item. I need fast insertion and look up for the hash table. By the way, I am not allowed to use the Boost library in the implementation.

How could I do that?

like image 955
Ashley Avatar asked Apr 22 '26 20:04

Ashley


1 Answers

If you mean that two ints form a single key then unordered_map<std::pair<int,int>, value_type>. If you want to index the same set of data by multiple keys then look at Boost.MultiIndex.

like image 147
Yakov Galka Avatar answered Apr 24 '26 12:04

Yakov Galka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!