Boost logo

Boost Users :

Subject: Re: [Boost-users] Help in using smart (double) pointers
From: Sundaram (legends2k_at_[hidden])
Date: 2009-08-17 11:36:52


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_at_[hidden]>
To: boost-users_at_[hidden]
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_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users

      



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net