On Wed, Oct 22, 2003 at 11:23:51AM +0200, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | Martin Vermeer wrote:
> >>> > +        bool display() const { return false; }
> >
> >>> Why do you need these? The function defaults to false (inset.h).
> >
> >> ... but these inherit from InsetCommand, which sets it to true
> >> (correctly for most of its heirs).
> >
> | I'm pretty sure that this is bad practice. What I can say for certain 
> | is that you'll definitely end up confusing me if you keep changing 
> | the default value of the return of a virtual method as you go down 
> | the inheritence tree.
> >
> | I'd much prefer
> |         virtual bool InsetOld::display() const { return false; }
> | and then
> |         virtual bool InsetXYZ::display() const { return true; }
> | only for those insets that do actually want it.
> 
> yes. _OR_ make dispaly a pure virutal function and only define it for
> "leaf" classes.

Please not.

I don't want to add a function to 50 math insets just to make some
function pure virtual.

[Which is no real solution either, as one could start with an
implementation one level further down in the inheritance tree and create
the same mess there.]

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to