-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of young Sent: June-09-12 10:34 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] question about boost pointer
example:
class MyClass { boost::shared_ptrboost::shared_array<char> pBuff;
void getnextpacket(size) { pBuff = boost::shared_ptrboost::shared_array<char> (new boost::shared_array<char>(new char[size])); ... }
Why bother with boost::shared_ptr here? It adds nothing of value to the mix that I can see. Why not try something like: class MyClass { private: boost:shared_array<char> pBuff; public: void getNextPacket(size) { pBuff.reset(new char[size]); .... } ... } Cheers Ted