25 Feb
2006
25 Feb
'06
6:41 p.m.
pegacorn@jcom.home.ne.jp wrote:
How should I do to replace the constant pointer with shared_ptr?
int main() { const int *ip = new int(1); *ip = 2; // NG ip = new int(2); // OK }
How should I do to achieve the above-mentioned example by using shared_ptr?
int main() { boost::shared_ptr<const int> ip(new int(1)); *ip = 2; // NG ip.reset(new int(2)); //OK } Is it really hard to understand the documentation such that the answer isn't obvious? We would really like know so the documentation improves. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo