private method in interface

Jacob Carlborg doob at me.com
Sat Jun 4 03:00:46 PDT 2011


On 2011-06-03 23:55, Michael Shulman wrote:
> On Fri, Jun 3, 2011 at 1:02 PM, Jonathan M Davis<jmdavisProg at gmx.com>  wrote:
>> And if you don't know about NVI, having a
>> virtual private function is just plain weird.
>
> Well, it makes perfect sense to me, once given that in D, 'private'
> allows access from anywhere in the same module, rather than only in
> the defining class.  I agree that it's weird and surprising in C++.
>
> Are 'package' qualified functions also non-virtual?  The documentation
>    http://d-programming-language.org/function.html#virtual-functions
> says that "all non-static non-private non-template member functions
> are virtual", but I get the same sort of linker errors with 'package'
> functions that I do with 'private' ones, even with code that's all in one
> module.
>
> Mike

The current implementation of "package" is non-virtual and, as far as I 
know, has always been like that. What it's actually supposed to be, I 
don't know.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list