8 Jun
2012
8 Jun
'12
3:49 p.m.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of young Sent: June-08-12 11:33 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] question about boost pointer
Can I define:
int a[100]; boost::shared_ptr<int> p(a);
and get next int by using p?
No. boost::shared_ptr is for objects created using operator new (and thus deleted using operator delete) while boost::shared_array is for objects created using operator new[] (and thus deleted using operator delete[]). use boost::shared_array instead, or for more flexibility, use std:;vector. HTH Ted