Re: 2 class issues

2019-03-07 Thread ag0aep6g via Digitalmars-d-learn
On 07.03.19 11:38, spir wrote: -1- How to enforce that subclasses implement given methods without using "abstract", which seems to make the whole class abstract? Not, as far as I can tell. You can't force derived classes to override an existing implementation. And you can't omit the implementa

Re: 2 class issues

2019-03-07 Thread Johannes Loher via Digitalmars-d-learn
Am 07.03.19 um 11:38 schrieb spir: > Hello, > > First, I am not very experimented with the combination of static lang > (alloc & typing) and OO (class-based). I'm implementing a library for > lexical analysis (lexing), with 2 minor issues: > > -1- How to enforce that subclasses implement given me

Re: 2 class issues -- PS

2019-03-07 Thread spir via Digitalmars-d-learn
from [https://dlang.org/spec/attribute.html#abstract] : --- abstract Attribute An abstract member function must be overridden by a derived class. Only virtual member functions may be declared abstract; non-virtual member functions and free-standing functions cannot be declared abstract