If I have two vectors and want to combine them to one, I can do it the following way:
std::vector<T> a(100); // just some random size here
std::vector<T> b(100);
a.insert(std::end(a), std::begin(b), std::end(b));
That involves copying though, which I want to avoid. Is there any way to use move-semantics to get them together?
I highly doubt it, as a vector
is supposed to be contiguous. However is there any way to do it with a deque
?