At the moment I am doing this:
const int n = 13;
std::vector<int> v(boost::counting_iterator<int>(0), boost::counting_iterator<int>(n + 1));
std::copy(v.begin(), v.end(), back_inserter(m_vecAssignmentIndex));
m_vecAssignmentIndex
is defined liek this:
ByteVector m_vecAssignmentIndex;
And, ByteVector
:
using ByteVector = std::vector<BYTE>;
Is it possible to assign directly to m_vecAssignmentIndex
and avoid std::copy
?
Update
So, code like this is OK:
std::vector<BYTE> v2(boost::counting_iterator<BYTE>(0), boost::counting_iterator<BYTE>(n + 1));
std::vector<int> v(boost::counting_iterator<int>(0), boost::counting_iterator<int>(n + 1));
std::copy(v.begin(), v.end(), back_inserter(m_vecAssignmentSortedIndex));
Thus, I can directly increment BYTE
values. So how can I avoid the requirement for the temp vector?