I have a vector of unique_ptr and I am trying to move them to another array but getting the error "invalid use of void expression".
I searched over the internet but could find this error linked only with "void*".
Here is the code snippet where the error pops up.
1 2 3 4 5 6 7 8 9 10 11 12
for (registerunsignedint i = 0; i < 10; ++i)
freeSlots.push_back(std::make_unique<Slot>(i)); //1) Can we use
//std::move here ? will it be more efficient assuming Slot is a heavy to build object
filledSlots.push_back(std::move(freeSlots.pop_back())); //2) gives error
I have inlined the questions as 1) and 2).
Any help would be really great. Also could you kindly suggest me some good reads for move semantics... I am always confused in this part.. :(