如果在将对象移动到 std::vector 时内存分配失败,并且抛出 bad_alloc,std::vector 是否保证从对象移动的对象不变/仍然有效?
例如:
std::string str = "Hello, World!";
std::vector<std::string> vec;
vec.emplace_back(std::move(str));
/* Is str still valid and unaltered if the previous line throws? */