20.09.2013 23:09, Jonathan M Davis пишет:
You can use NVI with classes just fine just so long as you use protected rather
than private, but making it private there won't work either, because private
is never virtual (and it wouldn't really help you any if it were, because
while the base class pri
On Friday, September 20, 2013 22:40:48 Alexandr Druzhinin wrote:
> 20.09.2013 12:45, Ali Çehreli пишет:
> > On 09/19/2013 10:31 PM, Alexandr Druzhinin wrote:
> > > if I use protected instead of private in interface like:
> > private member functions are non-virtual.
>
> But I just use code exampl
20.09.2013 12:45, Ali Çehreli пишет:
On 09/19/2013 10:31 PM, Alexandr Druzhinin wrote:
> if I use protected instead of private in interface like:
private member functions are non-virtual.
But I just use code example from TDPL russian edition. And TDPL says
clearly that (un)transmogrify() are
On 09/19/2013 10:31 PM, Alexandr Druzhinin wrote:
> if I use protected instead of private in interface like:
private member functions are non-virtual.
> interface Transmogrifier
> {
> final void thereAndBack()
> {
> transmogrify();
> untransmogrify();
> }
>
>
if I use protected instead of private in interface like:
interface Transmogrifier
{
final void thereAndBack()
{
transmogrify();
untransmogrify();
}
protected:
void transmogrify();
void untransmogrify()
Hello all.
I try to use NVI and failed with a snippet from TDPL:
interface Transmogrifier
{
final void thereAndBack()
{
transmogrify();
untransmogrify();
}
private:
void transmogrify();
void untransm
>
> In D, the public function would have to be final to make it non-virtual/non-
> overridable, and the function it calls would have to be protected, since you
> can't override private functions (
> http://d.puremagic.com/issues/show_bug.cgi?id=4542 ). In this case, you're
> trying to override fina
>
> What you may want to consider is an abstract class instead of NVI, as long
> as you don't need multiple inheritance, it should be fine.
>
> -Steve
>
Well, I've decided to give NVI a try just because multiple inheritance
would be best way to do what I want (aldo I hate that feature of C++
and j
On Friday, March 04, 2011 02:17:00 Aleksandar Ružičić wrote:
> I'm trying to use NVI idiom but i keep getting errors from dmd.
>
> This is my setup:
>
> module test;
>
> import std.stdio;
>
> interface IBase {
> void foo();
> void bar();
> }
>
> interface IBar : IBase {
> fin
On Fri, 04 Mar 2011 05:17:00 -0500, Aleksandar Ružičić
wrote:
I'm trying to use NVI idiom but i keep getting errors from dmd.
This is my setup:
module test;
import std.stdio;
interface IBase {
void foo();
void bar();
}
interface IBar : IBase {
final void bar() {
I'm trying to use NVI idiom but i keep getting errors from dmd.
This is my setup:
module test;
import std.stdio;
interface IBase {
void foo();
void bar();
}
interface IBar : IBase {
final void bar() {
writefln("IBar.bar()");
}
}
class Foo : IBar
11 matches
Mail list logo