Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple keys for a map in C++ [duplicate]

I have a table where the entries are something like this

Row - Column1 - Column2 - Column3 Column4

 1     0X0A      1          2      A
 2     0X0B      2          2      B
 3     0x0C      3          2      C

Now i want to use map in such that i can use column 1 or Column 2 as the key to get the row. What kind of map i should use to achieve this?

(Note- Table is just for explanation and not the exact requirement) I thought of using multimap, but that is not going to solve the prob

like image 389
jhon Avatar asked Nov 08 '25 10:11

jhon


1 Answers

try multi-index containers from boost.

like image 137
Irit Katriel Avatar answered Nov 10 '25 06:11

Irit Katriel