I have a pair and a map declared as such
typedef pair<string,string> Key;
typedef map< Key, double> Map;
i insert objects into them via a for loop as such
Key p (string1, string2 );
pair_map.insert(make_pair( p, double1 ) );
how can i find elements in the map? I am having trouble setting up the iterator with find.
Suppose I’m using it = pair_map.find(make_pair(string1,string2));
I’ve tried declaring pair_map<Key, double>::iterator it; or map<Key, double>::iterator it; but neither are working for me. How can i fix this?
the errors i get are all long invalid cast errors because of the typedef’s
And of course you can use
or
in C++11.