Is there any way to make this code work? (combine "Free Lists" and "Explicit Class Instance Allocation")

Sclytrack sclytrack at pi.be
Sat Aug 16 00:57:42 PDT 2008


== Extrait de l'article de « z (z at gg.com) »
> == Quote from z (z at gg.com)'s article
> > Hi,
> > I'm reading http://digitalmars.com/d/2.0/memory.html
> > and try to combine "Free Lists" and "Explicit Class Instance Allocation".
;
> class Bar {
>     public void fun() {
>       printf("Bar\n");
>     }
> }
> class Foo : Bar {

It would be easier of you split them up in two objects not inheriting from
one another.

class Bar {}           //Use Explicit Class Instance Allocation here
class BarFreeList {}   //And free list here. Hmm maybe even a template.





More information about the Digitalmars-d mailing list