Date: Fri, 29 Apr 2005 10:56:14 +0200 From: David Gruener
Subject: Re: [Boost-users] Re: pimpl and boost To: boost-users@lists.boost.org Message-ID: <4271F6AE.20509@idmt.fraunhofer.de> Content-Type: text/plain; charset=us-ascii; format=flowed Pavel Antokolsky aka Zigmar wrote:
auto_ptr - compiled with warning about destroying incomplete type
As i already mentioned, very little to no benefit here over plain pointer.
shared_ptr - compiled and worked - the destructor of
Yes, but you still have to provide assignment and copy constructor for your standard cases. So, as i stated, little benefit here over plain pointer too and an ideological problem that shared_ptr used in this way, as serveral times suggested, isn't a shared pointer anymore. Again, whats needed is a pointer like Griffiths's grin_ptr or Peter's impl_ptr. I'm looking forward to the policy pointers.
--David
I agree, if/when the need next arises, I will find/write an impl_ptr<>. I will also go with the technique mentioned earlier of ONLY putting the data in the impl_ptr, and not forwarding all the functions. (Still think it should be part of the language though. C++ proclaims to enable data-hiding, but it really doesn't. The speed/data-hiding trade-off that C++ originally made was fine for the times, but now that trade-off isn't so necessary...)