Abstract attribute ?

Lucien via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 17 09:52:01 PDT 2016


Hello,

Why a attribute cannot be abstract ?
How can I force the redefinition of an attribute if the class 
inherits from abstract class ?

Example:
----------------

abstract class A
{
// Error: variable attr cannot be abstract
protected abstract int attr;
}

class B : A
{
protected override int attr = 10;
}


More information about the Digitalmars-d-learn mailing list