|
Boost Users : |
Subject: Re: [Boost-users] [Q] scoped_ptr for forward declared classes
From: V S P (toreason_at_[hidden])
Date: 2009-03-31 13:18:06
Hello,
thank you
I tried that, but it does not work
I think the
scoped_ptr needs the destructor implementation of
my hidden impl
but that I cannot provide (because I use header files from a library
that
I cannot expose).
I for now switched to just regular ptr
and still trying to debug why shared_ptr reports mem leaks with Visual
Studio.
thank you again,
Vlad
On Tue, 31 Mar 2009 19:38 +0300, "Peter Dimov" <pdimov_at_[hidden]>
wrote:
> V S P:
> > Hello
> >
> > I have a situation where
> > I have
> >
> >
> > struct cmoney_impl_dtl; //hidden impl is in Cpp file
> > struct myclass
> > {
> >
> > boost::scoped_ptr<hidden_impl> myimpl_ptr;
> >
> > }
>
> You must declare ~myclass in the header and implement it in the .cpp
> file.
> If your class didn't have a destructor you'd need
>
> myclass::~myclass() {}
>
> Otherwise, just move the implementation of ~myclass into the .cpp file.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- V S P toreason_at_[hidden] -- http://www.fastmail.fm - Send your email first class
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net