Is there an algorithm in the STL to move elements similar to how std::copy works? I have read various places that the new C++ standard has a move algorithm. Unfortunately the compiler I use (g++ (GCC) 4.2.0) does not support any C++0x updates.
I have a std:
eque that I want to move a range from into an array. I am currently using something like this where
data_array is an unsigned char pointer to a buffer being passed in by the caller
dataQ is a std:
eque<unsigned char> that is a member variable maintained within the class
Code:
for (int i = 0; i < numberBytesRequested; ++i)
{
data_array[i] = dataQ.front();
dataQ.pop_front();
}
I'm concerned that executing this loop over and over again is going to be very inefficient. I am looking for a more efficient way to do this.
Thanks for the help.