Boost logo

Boost :

From: Rainer Deyke (root_at_[hidden])
Date: 2001-04-03 14:13:33


----- Original Message -----
From: "Beman Dawes" <bdawes_at_[hidden]>
To: <boost_at_[hidden]>; <boost_at_[hidden]>
Sent: Tuesday, April 03, 2001 11:49 AM
Subject: Re: [boost] Re: scoped_ptr: trivial dtor?

> At 10:20 AM 4/3/2001, Rainer Deyke wrote:
> >// C.hpp
> >class Cimpl;
> >class C {
> >public:
> > ~C();
> >private:
> > boost::scoped_ptr<Cimpl> impl;
> >};
> >
> >// C.cpp
> >class Cimpl {
> >};
> >
> >C::~C()
> >{
> >}
> >
> >Am I missing something, or are you talking about a different idiom?
>
> That is the idiom I was talking about.

Then there shouldn't be a problem. Declaring '~C' in 'C' and placing the
definition for 'C::~C' below the definition for 'Cimpl' causes 'Cimpl' to be
a complete type at the point where 'scoped_ptr<Cimpl>::~scoped_ptr' is
called. 'Cimpl' doesn't even need a trivial destructor.

--
Rainer Deyke (root_at_[hidden])
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor

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