by Bart van Ingen Schenau <bart@[EMAIL PROTECTED]
>
Jul 10, 2008 at 05:53 PM
Hansen wrote:
> Hi Group,
>
> Is it possible to make an abstract class without having any virtual
> functions?
Not in the sense that the C++ standard uses the term 'abstract class'.
In that sense, at least one member function must be declared as pure
virtual for a class to be abstract. This member function could be the
destructor.
> I have a fully functional class, but the plan is that one must derive
> from it in order to make more specialized cl*****.
I don't see how this design is going to work.
If the base class does not have any virtual functions, a derived class
will not be able to override/enhance the base class behaviour, so what
advantage does it give you to derive from this base class?
What you also have to watch out for, is that you can't do
Base* b = new Derived;
delete b;
unless Base has a virtual destructor.
>
> /Hansen
Bart v Ingen Schenau
--
a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq
c.l.c FAQ: http://c-faq.com/
c.l.c++ FAQ: http://www.para****ft.com/c++-faq-lite/