std.container and classes

foobar foo at bar.com
Wed Dec 21 09:24:02 PST 2011


On Wednesday, 21 December 2011 at 16:39:13 UTC, Andrei 
Alexandrescu wrote:
>
> (Please don't overquote. It took me a million years to scroll 
> all the way down on my phone. Thanks.)
>
> This is an alluring proposition but it's a lot more difficult 
> than one might think. The problem is the entire container 
> design is different if e.g. using refcounting vs. classic 
> garbage collection.
>
> You may want to try designing a simple container and isolate 
> all memory/lifetime-specific issues into an allocator. See what 
> allocator interface you come up with. I was unable to solve 
> this problem, but it's possible it has a solution.
>
>
> Andrei

Could you give an example to illustrate this design difference? 
Which container would be affected by this?

There's already one good allocator API design I'm aware of:  
http://www.open-std.org/Jtc1/sc22/wg21/docs/papers/2005/n1850.pdf
Can we reuse the design/ideas or can you see problems with it?


More information about the Digitalmars-d mailing list