J
Jim Langston
I am working with triangle lists and clases dealing with them to create 3d
objets. One of the things I prefer to do is store my data in vectors. If I
am going to be iterating over all the elements in the vector (which I would
be while loading it) I want to be able to resize the vector and be done with
it. However. I understand that resize not only sets aside the memory but
initializes the memory to 0. Looking over the definitions seems to confirm
this.
This is where I hope my understanding is wrong, because I really don't want
to add the overhead of initializing the memory when I will be iterating over
and setting the memory in the next few lines of code. But I seem to be
missing that third option, resize_dont_clear() or whatever it would be.
Is this just something I'm not going to get without writing my own container
class or am I missing something. Or the 3rd choice, I shouldn't worry about
the time required to clear memory.
objets. One of the things I prefer to do is store my data in vectors. If I
am going to be iterating over all the elements in the vector (which I would
be while loading it) I want to be able to resize the vector and be done with
it. However. I understand that resize not only sets aside the memory but
initializes the memory to 0. Looking over the definitions seems to confirm
this.
This is where I hope my understanding is wrong, because I really don't want
to add the overhead of initializing the memory when I will be iterating over
and setting the memory in the next few lines of code. But I seem to be
missing that third option, resize_dont_clear() or whatever it would be.
Is this just something I'm not going to get without writing my own container
class or am I missing something. Or the 3rd choice, I shouldn't worry about
the time required to clear memory.