GC vs. Manual Memory Management Real World Comparison

Benjamin Thaut code at benjamin-thaut.de
Wed Sep 5 05:10:03 PDT 2012


Am 05.09.2012 14:07, schrieb Benjamin Thaut:
> class A {}
> class B : A{}
>
> A a = new A();
> B b = new B();
>
> if(a == b) //this will allocate
> {
> }

Should be:

class A {}
class B : A{}

const(A) a = new A();
const(B) b = new B();

if(a == b) //this will allocate
{
}


More information about the Digitalmars-d-announce mailing list