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

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Tue Jan 23 00:44:18 PST 2007


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)

Andrei



More information about the Digitalmars-d mailing list