virtual, package, private

deadalnix deadalnix at gmail.com
Tue Jun 18 01:38:39 PDT 2013


On Tuesday, 18 June 2013 at 08:34:51 UTC, Paulo Pinto wrote:
> On Tuesday, 18 June 2013 at 07:57:23 UTC, deadalnix wrote:
>> On Tuesday, 18 June 2013 at 07:27:50 UTC, Namespace wrote:
>>> I'm also for an explicit 'virtual' keyword.
>>> But I don't get why private methods should be virtual? That 
>>> makes never sense.
>>
>> Because the unit of encapsulation in D is the module not the 
>> class.
>
> Still it does not make sense.
>
> If a method is supposed to be overridable by others but not 
> visible outside of the class that is what protected is for.
>
> I have experience in several OO languages and I consider C++'s 
> private virtual
> belongs to the same dustbin as checked exceptions, as I am yet 
> to find any design scenario where it makes sense.
>

private in D don't have the same meaning as private in C++ . You 
are comparing apple and oranges.


More information about the Digitalmars-d mailing list