What you do with this empty method is essentially the same as manually assigning a newly constructed object to a variable (the thing that the Empty function does).
Personally, I delete the Empty method and replace all its use as follows:
// let say, that you have variables foo and pfoo - they are properly initialized. Foo foo, *pfoo; // replace line "foo.Empty()" with: foo = Foo(); // replace line "pfoo->Empty()" with: delete pfoo; pfoo = new Foo(); // or *pfoo = Foo();
I really don't see the benefits of using this empty method. He hides what really happens with the object on the witch, which he named, and this is not the best choice.
If the caller really wants a clean object, he will have no problem constructing the object itself.
source share