J
Jim Langston
I was revisiting some code and I came across this:
Class Client
{
// ...
void ResetClass()
{
COptions SaveOptions = Options;
this->~CClient();
new (this) CClient();
Options = SaveOptions;
}
// ...
};
That use of calling delete and placement new on this seems dubious and I
wonder if it's effects are well defined or undefined.
Class Client
{
// ...
void ResetClass()
{
COptions SaveOptions = Options;
this->~CClient();
new (this) CClient();
Options = SaveOptions;
}
// ...
};
That use of calling delete and placement new on this seems dubious and I
wonder if it's effects are well defined or undefined.