
Hey Shmelev, Amazing! That's exactly what I want! Stupid me, I didn't think of this at all. Instead I was just trying shared_array of shared_ptrs: shared_array< shared_ptr<int>* > palette (new shared_ptr<int>* [5]); It never occurred to me to use shared_array inside too :) Also, I learned the usage of reset in smart pointers. Now it works like a charm. Once again, thanks a lot. Solves a lot of headache, phew! Regards Sundaram ________________________________ From: Roman Shmelev <rshmelev@gmail.com> To: boost-users@lists.boost.org Sent: Monday, August 17, 2009 6:04:20 PM Subject: Re: [Boost-users] Help in using smart (double) pointers I guess, you need shared_array of shared_array<int>.
int **palette = new int* [5]; palette[0] = new int[10]; palette[1] = new int[7];
Something like: shared_array<shared_array<int>> palette (new shared_array<int>[5]); palette[0].reset(new int[10]); _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users