C
Christian Christmann
Hi,
what is the most efficient way to insert a new element into an
STL vector before a given element?
My idea was:
vector< Objects > myVector;
myVector.push_back( ...
myVector.insert(
find( myVector.begin(), myVector.end(), existElement ), newElement );
[where newElement and existElement are entities of Objects's class].
Does this look OK for you? ;-)
Or are there simpler approaches?
Regards,
Chris
what is the most efficient way to insert a new element into an
STL vector before a given element?
My idea was:
vector< Objects > myVector;
myVector.push_back( ...
myVector.insert(
find( myVector.begin(), myVector.end(), existElement ), newElement );
[where newElement and existElement are entities of Objects's class].
Does this look OK for you? ;-)
Or are there simpler approaches?
Regards,
Chris