Abstract functions in child classes

Regan Heath regan at netmail.co.nz
Thu Dec 1 09:58:24 PST 2011


On Thu, 01 Dec 2011 17:50:48 -0000, Adam <Adam at anizi.com> wrote:
> Ok, starting to feel like I'm missing something obvious...

This:

     void main() {
         Child child = new Child;
     }

also produces the (expected) error.  Basically dmd was letting you get  
away with the abstract class because you never instantiated it.

Child child;

is just a reference to a Child class.

You could argue the compiler should error in either case, in fact, I  
would.  But perhaps there is a good generic programming reason not to...  
someone more experienced might be able to shed some light on it.

Regan

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d-learn mailing list