R
Rahul
Hi,
I tried to create a abstract class by having a non-virtual member
function as pure, but i got a compilation error saying "only virtual
member functions can be pure"...
I'm trying to think the reason behind this restriction... i just want
to want a base class to be abstract so as to avoid object slicing into
the base type from derived type, and in my case base class doesn't
need to have a virtual function.
Is there any alternative? and what is the reason behind only virtual
member functions being pure?
I tried to create a abstract class by having a non-virtual member
function as pure, but i got a compilation error saying "only virtual
member functions can be pure"...
I'm trying to think the reason behind this restriction... i just want
to want a base class to be abstract so as to avoid object slicing into
the base type from derived type, and in my case base class doesn't
need to have a virtual function.
Is there any alternative? and what is the reason behind only virtual
member functions being pure?