
11 Oct
2007
11 Oct
'07
10:57 a.m.
Vladimir Batov wrote:
Given I've been using this Pimpl idiom quite extensively lately I've noticed writing the same scaffolding over and over again.
Maybe we need something with a mixture of features from scoped_ptr and shared_ptr. scoped_ptr does everything that I need for a pimpl, except that it can't delete the incomplete implementation type. shared_ptr can delete the incomplete implementation, but it has the unneeded overhead of reference counting and thread safety issues. So, can the incomplete deletion feature of shared_ptr be extracted and added to scoped_ptr? I have just had a quick look at the shared_ptr implementation to see how deletion works, but it's too clever for me to understand.... Regards, Phil.