
11 Oct
2005
11 Oct
'05
5:24 p.m.
Bronek Kozicki wrote:
As I understand, checked_delete is being used by scoped_ptr to prevent deletion of incomplete type. However, this very simple program is accepted by MSVC6, MSVC71 and MinGW (GCC) 3.4.4, even though implicit destructor of A is deleting incomplete class A::impl.
Apparently, ~A is being implicitly generated at the end of the translation unit, where A::impl is complete. If you add ~impl that prints something, you'll see that it is actually being called. If you remove the definition of A::impl, the program will no longer compile. At least under MSVC 7.1.