Boost logo

Boost Users :

Subject: [Boost-users] [Q] scoped_ptr for forward declared classes
From: V S P (toreason_at_[hidden])
Date: 2009-03-31 12:31:26


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;


The compiler complains that the struct hidden_impl
must be fully defined in the header file (which I cannot do)
c:\usr\local\boost.msvc2008\boost_1_38_0\boost\checked_delete.hpp(32) :
error C2027: use of undefined type 'cmoney_impl_dtl'
        c:\dbt_money.hpp(38) : see declaration of 'cmoney_impl_dtl'
        : see reference to function template instantiation 'void
        boost::checked_delete<T>(T *)' being compiled

is there a way around this?

I was trying to use shared_ptr there, but MSVC reports memory leak on
those objects...
so I must be doing something wrong there , and therefore just wanted to
try a simple ptr.

thanks in advance,

  V S P
-- - Same, same, but different...

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at