Broken?

Szymon Gatner noemail at gmail.com
Wed Mar 12 07:49:42 PDT 2014


On Wednesday, 12 March 2014 at 13:53:28 UTC, Steven Schveighoffer 
wrote:
> On Wed, 12 Mar 2014 09:45:22 -0400, monarch_dodra 
> <monarchdodra at gmail.com> wrote:
>
>> On Wednesday, 12 March 2014 at 13:22:34 UTC, Steven 
>> Schveighoffer wrote:
>>> OK, I can see that being useful. You are right, I was 
>>> thinking C++ private.
>>>
>>> -Steve
>>
>> Even in C++, private virtual a key part of the "non-virtual 
>> interface" thing.
>>
>> EG: You define your base class as having only non-virtual 
>> public functions, and private virtual function. They are 
>> private, so the derived classes can't *call* them, but they 
>> can still override them.
>
> Nonsense. If I'm writing a function, I can call it. There is no 
> way to prevent it. e.g.:
>

The point is that you can't call parent's virtual (often 
abstract) method. Of course you can call method you define but 
that is not the point of NVI.


More information about the Digitalmars-d mailing list