When does final mean "maybe, kinda, sorta" ?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Tue Jan 23 03:08:39 PST 2007


Andrei Alexandrescu (See Website For Email) wrote:
> Sean Kelly wrote:
>> Andrei Alexandrescu (See Website For Email) wrote:
>>> Sean Kelly wrote:
>>>> class Base
>>>> {
>>>> private:
>>>>     virtual void fn() = 0;
>>>> };
>>>>
>>>> class Derived : Base
>>>> {
>>>> public:
>>>>      virtual void fn() {}
>>>>     void call() { fn(); }
>>>> };
>>>>
>>>> Sure, you can't call it through Base::fn(), but... :-)
>>>
>>> Oh, my hope was that D disallows republicizing private functions :o(. 
>>> Spectacular failure to provide a great feature...
>>
>> I think it effectively does, since private functions can not be 
>> overridden.  The above was C++ (I should have labeled the code).
> 
> That's great news. The semicolons should have informed me... oh, and 
> wait, there's no "virtual" in D... :o)

And there's definitely no '= 0' at the end of method declarations. Oh, 
and his comment at the end mentioned 'Base::fn()' instead of 'Base.fn()' :)



More information about the Digitalmars-d mailing list