E
er
hi,
of A and B below i have a feeling A is more efficient although i'm
used to doing A unless i can't... could someone kindly confirm/refute?
//A
vector<T> vec;
vec.reserve(n);//only allocates mem.
transform(...,back_inserter(vec));
//B
vector<T> vec(n);//uses T's default constructor to fill the vector
transform(...,vec.begin());
of A and B below i have a feeling A is more efficient although i'm
used to doing A unless i can't... could someone kindly confirm/refute?
//A
vector<T> vec;
vec.reserve(n);//only allocates mem.
transform(...,back_inserter(vec));
//B
vector<T> vec(n);//uses T's default constructor to fill the vector
transform(...,vec.begin());