Home » Community » Newbie corner » Map with unique keys and transfer semantics?
Re: Map with unique keys and transfer semantics? [message #46472 is a reply to message #46465] |
Sat, 14 May 2016 05:28   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
If VectorMap otherwise satisfy your need, I would use VectorMap as it appears to be more economic. You have control over the VectorMap object, so you can enforce uniqueness by yourself. If its going to be exposed to somebody else, enclose it in a class and expose Add method that would either replace existing value (value as in key-value pair) or throw or return false...
The fact VectorMap allow multiple record to have the same key (kind of like std::multimap ) should not prevent you from enforcing uniqueness as you have full control over its object.
Just my 2 cents.
[Updated on: Sat, 14 May 2016 05:30] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 30 03:24:09 CEST 2025
Total time taken to generate the page: 0.01019 seconds
|