
14 Apr
2003
14 Apr
'03
9:49 p.m.
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; in the cpp: CCPUDetect * gCPU = CCPUDetect::GetInstance(); I have problems to make the same with boost, so that gCPU is a smartpointer. Thanks, Christian Gmeiner [Non-text portions of this message have been removed]

15 Apr
15 Apr
10:59 a.m.
Christian Gmeiner wrote:
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<>.
8058
Age (days ago)
8059
Last active (days ago)
1 comments
2 participants
participants (2)
-
Christian Gmeiner
-
Edward Diener