Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-09-17 13:04:16


On 09/17/07 09:55, Achilleas Margaritis wrote:
> Larry Evans wrote:
[snip]
>> However, I'm still wondering if it cppgc can handle
>> gc_ptr<std::vector<T> > or pointer to any other std container.
>> Do you have tests for these cases?
>
> It's very easy to make an STL allocator for gc: the allocator's pointer
> type will be gc_ptr<T>.
>
> The following will be possible:
>
> gc_ptr<std::vector<gc_ptr<Foo> > foos = gc_new std::vector<gc_ptr<Foo> ,
> gc_allocator<T> >;
>
Could you provide one in some test code which demonstrates that
the garbage is actually collected and which handles cycles.
For example, a gc_ptr<std::vector<T> > where T contains a
gc_ptr<std::vector<T> > which points to the containing vector.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk