lundi 2 mars 2015

How to return an Iter to 'n' selected objects from a std::map of 'm' objects (c++)

I am using a std::map in C++.



typedef map< LONG_32, Dataobject > DataobjectMap;
typedef map< LONG_32, DataObject >::iterator DataObjectMapIterator


Now at times while writing various functions for this Map, I would like to return an iter with some specific object which follows certain properties.


for example: I can Iterate through complete map, then i would like to return an iter to the DataObjects which have some specific properties.


Will I have to create a new map with the specific objects ? and then retunr an iter to this new map ?


Aucun commentaire:

Enregistrer un commentaire