Re: How to declare a virtual member (not a function) in a class

2020-02-18 Thread Petar via Digitalmars-d-learn
On Tuesday, 18 February 2020 at 12:37:45 UTC, Adnan wrote: I have a base class that has a couple of constant member variables. These variables are abstract, they will only get defined when the derived class gets constructed. class Person { const string name; const int id; } class Male

Re: How to declare a virtual member (not a function) in a class

2020-02-18 Thread Simen Kjærås via Digitalmars-d-learn
On Tuesday, 18 February 2020 at 12:37:45 UTC, Adnan wrote: I have a base class that has a couple of constant member variables. These variables are abstract, they will only get defined when the derived class gets constructed. class Person { const string name; const int id; } class Male

How to declare a virtual member (not a function) in a class

2020-02-18 Thread Adnan via Digitalmars-d-learn
I have a base class that has a couple of constant member variables. These variables are abstract, they will only get defined when the derived class gets constructed. class Person { const string name; const int id; } class Male : Person { this(string name = "Unnamed Male") {