Access Vector Objects by ID
-
Hi, I just want to know if it's possible to access a vector object by it's unique id. In vector objects don't have id's you can just access them by their locations! for example:
std::vector<myobject> objs;
objs.at(1).my_property = 'qwerty';here 1 is the location of the object in that vector and it's not unique.. it can change if you delete or add a object on top of this object. but i want to give them a unique id and access them by that. Any suggestions?
-
Hi, I just want to know if it's possible to access a vector object by it's unique id. In vector objects don't have id's you can just access them by their locations! for example:
std::vector<myobject> objs;
objs.at(1).my_property = 'qwerty';here 1 is the location of the object in that vector and it's not unique.. it can change if you delete or add a object on top of this object. but i want to give them a unique id and access them by that. Any suggestions?