abstract class information

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue May 30 15:19:37 PDT 2017


On Tuesday, May 30, 2017 22:13:54 Wulfklaue via Digitalmars-d wrote:
> I am just looking up abstract class information and i notice that
> there is no information on dlang.org/spec
>
> Yet using this as a resource:
>
> https://www.tutorialspoint.com/d_programming/d_programming_abstract_classe
> s.htm
>
> It can be found, with a proper example. Am i blind and not seeing
> it in the specs?
>
> Even Ali's book barely mentions it ( 55 ).
>
> And yet abstract classes exit and function in D. So strange.

http://dlang.org/spec/attribute.html#abstract

That part of the spec talks about the class becoming abstract if any of its
members are. Note that marking a class as abstract is equivalent to marking
all of its member functions with abstract, just like marking class with
@safe would make all of its member functions @safe. So, there isn't really
any special handling of marking the class itself as abstract.

- Jonathan M Davis



More information about the Digitalmars-d mailing list