mercredi 7 janvier 2015

Most efficient way to assign values to a map of maps

Given a map of maps like:



std::map<unsigned int, std::map<std::string, MyBase*>> m_allMyObjects;


What would be the most efficient way to insert/add/"emplace" an element into m_allMyObjects given an unsigned int and a std::string taking optimization into account (on modern compilers)?


What would be the most efficient way to retrieve an element then?


m_allMyObjects may potentially contain up to 100'000 elements in the future.


Aucun commentaire:

Enregistrer un commentaire