On 19-08-2013 16:30, Larry Evans wrote:
On 08/19/13 09:06, Thorsten Ottosen wrote:
Since the size of vector
is no bigger than vector , it's probably better just to allow forward iteration and then let the user create a vector as they want (for full random access manipulation). -Thorsten
However I assume you meant vector
to contain pointers to elements in the vector<char> storage of the container. But what happens if storage needs to be resized? OTOH, using vectorstd::size_t to store the offsets would not be invalidated by resizing storage.
True, there are different tradeoffs.
At least in my use cases, the objects would be loaded at application
start, and remain in memory until the application exists. Therefore,
I can create a vector