i'm trying to extract a subvector of int from another subvector of int using iterator with this code :
std::vector<int> Original;
std::vector<int> NewVec;
NewVec(Original.begin(), Original.begin()+5);
and this doesn't work, only if i declare NewVec in the same line of extraction like that :
std::vector<int> NewVec(Original.begin(), Original.begin()+5);
So, is it possible to use NewVec such that its declaration is before its construction ? Thanks.