Vector resize without initialization
vector.resize is defined to resize the vector, and initialize the new
objects with either the default value T() or a value you can provide.
But, I'm working on something that's very performance aware, and i need to
resize the vector without assigning a value, and assign the values later
on.
I know I can use an Allocator class and replace the construct member
function.
But the problem with that is that it will change the vector template
signature, and may cause a LOT of changes in the code (I have a large code
base, and this is basically important in one small utility function).
Is there a way to do that without using an Allocator ?
No comments:
Post a Comment