1

So lets say I have: map<pair<int, MyEnum>, string> myMap;

and I add a key value: myMap[make_pair(1, MyEnum::first)] = "something";

how can I retrieve the value "something"

so if the map was map<int, string> and I had myMap[1] = "something";

i would say string s = myMap[1]

4

2 に答える 2

4

同じやり方で、

std::cout << myMap[make_pair(1, MyEnum::first)] << std::endl;

出力:

something

お役に立てば幸いです。

于 2012-03-08T15:33:49.757 に答える
0
string s = myMap[make_pair(1, MyEnum::first)];
于 2012-03-08T15:34:32.963 に答える