|
Boost Users : |
From: Edward Diener (eddielee_at_[hidden])
Date: 2003-04-15 05:59:11
Christian Gmeiner wrote:
> Hi!
>
> I want to use boost's shared_ptr in my project, which is a dll.
> At the moment it looks like this:
>
> in the h:
> extern MY_API CCPUDetect * gCPU;
extern boost::shared_ptr<CCPUDetect> gCPU;
>
> in the cpp:
> CCPUDetect * gCPU = CCPUDetect::GetInstance();
boost::shared_ptr<CCPUDetect> gCPU(CCPUDetect::GetInstance());
I assume that CCPUDetect::GetInstance() returns a dynamically allocated raw
pointer to CCPUDetect. If not, then you shouldn't be using a smart pointer
construct such as boost::shared_ptr<>.
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