
13 Jul
2007
13 Jul
'07
7:31 a.m.
On Fri, 13 Jul 2007 13:52:18 +0800 (CST), hongleij@126.com wrote: <...>
class CPeer;
#include
#include class CPeerManager { public: CPeerManager(); boost::scoped_ptr<CPeer> cp_; //error // boost::shared_ptr<CPeer> cp_; // ok };
<...> The scoped_ptr is defined to be simple and to load as little as possible the code using it. To uses all potimizations possible, it's been designed in such a way that the struct pointed byt it must be completely defined when the pointer is declared, so you should replace the forward declaration "class C>Peer;" with the full declaration (typically, ibcluding its corresponding header regrads, Zara