Hi all,
Is it legal to kill an object and build a new one of the same type in its
memory?
class A{
int i;
public:
explicit A(int value): i(value){}
};
int main(){
A a(3);
a.~A();
new (&a)A(2);
}
--
There is this special biologist word we
use for 'stable.' It is 'dead.' -- Jack Cohen
Is it legal to kill an object and build a new one of the same type in its
memory?
class A{
int i;
public:
explicit A(int value): i(value){}
};
int main(){
A a(3);
a.~A();
new (&a)A(2);
}
--
There is this special biologist word we
use for 'stable.' It is 'dead.' -- Jack Cohen
Comment