What is the result of following statement?
std::string p;
new (&p) std::string("New word");
Does it create a new heap allocation? or does it just replace the static variable ? How does it differ from the following?
p = std::string("New word");
p = new std::string("New word");
EDIT: Thanks guys. Yeah it seems it's a placement new.