D
Daniel Kay
Hi Folks!
Everytime I work with virtual and pure virtual methods I ask myself if
there is a difference between class B and class C (see below). Is it
redundant to repeat the virtual keyword in a derived class? Or is there
any difference I need to consider? I have seen both ways when I read
source code from external sources. So far I didn't find any answers in
my books or on the net.
class A {
public:
virtual void foo() = 0;
virtual void bar() {}
};
class B {
public:
void foo() {}
void bar() {}
};
class C {
public:
virtual void foo() {}
virtual void bar() {}
};
CU,
Daniel Kay
Everytime I work with virtual and pure virtual methods I ask myself if
there is a difference between class B and class C (see below). Is it
redundant to repeat the virtual keyword in a derived class? Or is there
any difference I need to consider? I have seen both ways when I read
source code from external sources. So far I didn't find any answers in
my books or on the net.
class A {
public:
virtual void foo() = 0;
virtual void bar() {}
};
class B {
public:
void foo() {}
void bar() {}
};
class C {
public:
virtual void foo() {}
virtual void bar() {}
};
CU,
Daniel Kay