June 04, 2011 Re: private method in interface | ||||
---|---|---|---|---|
| ||||
On 2011-06-03 21:52, Michael Shulman wrote: > On Fri, Jun 3, 2011 at 8:54 PM, Jonathan M Davis <jmdavisProg@gmx.com> wrote: > > Try to compile with -w. My guess is that you will get a compiler error. > > Nope. Then file a bug report on it. As I understand it, overriding a non-virtual function in D should be illegal. Certainly, it goes against how D deals with virtuality in general. - Jonathan M Davis |
June 04, 2011 Re: private method in interface | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michael Shulman | On 2011-06-03 23:55, Michael Shulman wrote: > On Fri, Jun 3, 2011 at 1:02 PM, Jonathan M Davis<jmdavisProg@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 |
Copyright © 1999-2021 by the D Language Foundation