// original val is also destroyed here, but contains no value so it's fine } Note that std::move does not actually move anything, it just changes how the compiler treats the value at this particular place.