H
He Shiming
Hi Folks,
Happy holidays! I have a question regarding STL multimap. Basically, the
current multimap<int,int> look like this:
key=>value
1=>10,
1=>20,
1=>30,
When I'm inserting new key value pairs, I need to ensure that those pairs
already in the multimap can't be inserted again. Say that 1=>40 is okay, but
1=>10 is not okay. So that I get unique key->value pairs in the multimap.
I know that upon each insertion, I can do a check by iterating through keys
and values. But is there any easier or hopefully faster way to do this?
Thanks in advance,
Happy holidays! I have a question regarding STL multimap. Basically, the
current multimap<int,int> look like this:
key=>value
1=>10,
1=>20,
1=>30,
When I'm inserting new key value pairs, I need to ensure that those pairs
already in the multimap can't be inserted again. Say that 1=>40 is okay, but
1=>10 is not okay. So that I get unique key->value pairs in the multimap.
I know that upon each insertion, I can do a check by iterating through keys
and values. But is there any easier or hopefully faster way to do this?
Thanks in advance,