[gclist] boehm-gc and the STL

Patrick Draper pdrap-gclist@pdrap.org
Tue, 6 May 2003 11:54:43 -0500


On Tue, May 06, 2003 at 12:19:01PM -0400, David Jones wrote:
> 1. Write an allocator for STL objects that uses GC_malloc.  Drawback: since
>    C++ doesn't have "template typedefs", you need to write an ugly template
>    instantiation each time you want to use a container, e.g.:
> 
>    typedef std::vector<MyObject*,STL_GC_allocator<MyObject> > MyVector;

That's what I use, and it works well for me. If you typedef all your 
containers it's not really so bad.

-- 
Patrick Draper                | Don't  |sig4433@pdrap.org
Austin, Texas                 | Fear   |Father Order runs at a
http://www.pdrap.org          | The    |good pace, but old Mother
Be Microsoft Free - Use Linux |Penguin |Chaos is winning the race.