Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-12-20 16:40:12


----- Original Message -----
From: Peter Dimov <pdimov_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, December 20, 2001 5:35 PM
Subject: Re: [boost] BCB5, the pimpl idiom bug and the new Unit Test
Framework

> From: "Fernando Cacciola" <fcacciola_at_[hidden]>
> [...]
> > On a thread, I found a response from Nicola Musatti stating that the
Alan
> > Griffiths's "grin_ptr" does work with BCB, and can be used as a
> replacement
> > for 'boost::scoped_ptr' (scoped_ptr was explicitly mentioned)
>
> Have you looked at
>
> http://groups.yahoo.com/group/boost/files/impl_ptr/impl_ptr.html
>
> ?
>
> --
> Peter Dimov
> Multi Media Ltd.
>
Well, I just did, and it works like a charm!! :)

It is actually far better than grin_ptr<>.

For instance, I turned to my little pimpl test bed and confirmed that if you
use impl_ptr<> you don't longer need
to put the handle class destructor at a point where the body class is a
complete type, as you usually need to do with a traditional smart-pointer
based pimpl.

In other words, all these examples compiled and worked as expected:

#include <boost/impl_ptr.hpp>

struct A
{
   // compiler generated def ctor and dtor are OK
   A(...);

   friend class AImp ;
   boost::impl_ptr<AImp> pimpl ;
} ;

struct B
{
   B();
   // compiler generated dtor is OK

   friend class BImp ;
   boost::impl_ptr<BImp> pimpl ;
} ;

struct C
{
   C();
   ~C();

   friend class CImp ;
   boost::impl_ptr<CImp> pimpl ;
} ;

So...
How can we start using impl_ptr<>?
Does it need a review?

Or is it already released and I just missed it?

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk