U++ framework
Do not panic. Ask here before giving up.

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 Go to previous messageGo to previous message
Lance is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problems with AddPick operator| in Vector
Next Topic: Run a slow process in another thread to not block GUI
Goto Forum:
  


Current Time: Tue Jun 16 03:52:16 GMT+2 2026

Total time taken to generate the page: 0.00588 seconds