Disable GC entirely

Dicebot m.strashun at gmail.com
Wed Apr 10 03:48:18 PDT 2013


My understanding as based on dlang.org:

On Wednesday, 10 April 2013 at 10:29:05 UTC, Regan Heath wrote:
> Ok, lets Rewind for a sec.  I need some educating on the actual 
> issue and I want to go through the problem one case at a time..
>
>
> #1 If I write a class..
>
> class A
> {
>   public int isVirt()  { return 1; }
>   public int notVirt() { return 2; }
> }
>
> and compile it with another class..
>
> class B : A
> {
>   override public int isVirt() { return 5; }
> }
>
> and this main..
>
> void main()
> {
>   A a = new B();
>   a.isVirt();    // compiler makes a virtual call
>   a.notVirt();   // but not here
> }
>
> Right?

No. A is not final. A has no internal linkage. It can be 
inherited from in other compilation unit. notVirt is virtual.

Other answers are matching ;)


More information about the Digitalmars-d mailing list