Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 527
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: Mon May 13 07:48:47 CEST 2024

Total time taken to generate the page: 0.01954 seconds