Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-09-20 15:33:26


On 09/17/07 09:55, Achilleas Margaritis 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> >;
>
I think you'd have to change the implementation of the std containers
to make it work because many would use pointers and these would have
to be derived from the 'struct _ptr' defined in cppgc.hpp in order
for them to be registered in the pointer data base as described in
my other post:

http://archives.free.net.ph/message/20070920.142319.8368416a.en.html

Do you have any other idea about how it can be done?


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