And another pitfal with both auto_ptr and shared_ptr (at least on VC7.1 compiler) is if you don't provide expicit destructor, the generated destructor will try destroy the auto_ptr, which in its turn will try to destroy you pimpl via imcomplete pointer, therefor not calling destructor. Fortunately compiler at least gives a warning: "deletion of pointer to incomplete type 'TestClass::PrivateData'; no destructor called"
I suppose that a complete type is required to instanciate shared_ptr destructor and any function that will destroy the pointee. I was thinking that shared_ptr does ensure by itself that a complete type is used (contrary to auto_ptr) so that the type must be complete to compile properly. Do you just have a warning meaning that on older compiler someone might not even notice the problem. IMO, the fact that shared_ptr accept incomplete type but require a complete type is what make it interesting for pimpl. Philippe