I have a multimap and I want to save all of the unique keys in it in a vector.
multimap<char,int> mymm;
multimap<char,int>::iterator it;
char c;
mymm.insert(pair<char,int>('x',50));
mymm.insert(pair<char,int>('y',100));
mymm.insert(pair<char,int>('y',150));
mymm.insert(pair<char,int>('y',200));
mymm.insert(pair<char,int>('z',250));
mymm.insert(pair<char,int>('z',300));
How can I accomplish this?
There is a method for counting the number of items with a key, but none for counting the number of unique keys in a multimap.
Added: By unique, I mean all the keys in the multimap just once - they can be duplicated or appear only once in the multimap.
So unique keys here are - x, y and z