L
leeps_my
I'm thinking of using "resize-to-size" to do the trimming:
aVector.resize( aVector.size( ) );
I'm wondering why Scott Meyers was recommending "swap trick" instead,
since the trick involves construction and destruction of a temporary,
and might still leave some excess capacity in the vector.
aVector.resize( aVector.size( ) );
I'm wondering why Scott Meyers was recommending "swap trick" instead,
since the trick involves construction and destruction of a temporary,
and might still leave some excess capacity in the vector.