22 Apr
2005
22 Apr
'05
9:37 p.m.
"Bo Peng"
I need direct access ( save and use element pointers) to container elements in my application. std::vector<obj> can not be used since vector::push_back etc may relocate objs.
Just a suggestion: Can you, instead of storing objects in your vector, allocate the objects on the heap and store pointers (or shared pointers) to them? In this case you would not have to worry about the vector moving it's elements around -- it would be just moving pointers. Regards, Arkadiy