I know this is a very basic, probably even embarrassing, question, but I'm having trouble understanding this. If I std::move from something on the stack to another object, can the other object still be used when the original goes out of scope?
#include <iostream>
#include <string>
int
main(int argc, char* argv[])
{
std::string outer_scope;
{
std::string inner_scope = "candy";
outer_scope = std::move(inner_scope);
}
std::cout << outer_scope << std::endl;
return 0;
}
Is outer_scope still valid where I'm trying to print it?