[Issue 3396] Call of abstract method not detected by semantic check
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Aug 11 07:46:48 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=3396
--- Comment #7 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
(In reply to yebblies from comment #6)
> This code:
>
> abstract class A
> {
> abstract void M();
> }
>
> could mean one of two things:
> 1. M is a pure virtual function
> 2. M provides 'base class functionality', but this is a di file so the body
> isn't present.
You misuse terminology. "pure virtual function" is a C++ term which means "this
function should be overriden to be able to instantiate class". There is no term
for function that doesn't provide base class functionality. So D's 'abstract'
means exactly what C++'s '=0' postfix does marking function "pure virtual" in
contrast to e.g. C#'s 'abstract'.
--
More information about the Digitalmars-d-bugs
mailing list