Re: [sv-ec] RE: List of Mantis item for Monday June 29th Champions Meeting

From: Steven Sharp <sharp_at_.....>
Date: Mon Jun 22 2009 - 10:58:52 PDT
Jonathan's suggested replacement text says that a pure constraint
in a derived virtual class can replace an inherited pure constraint.

But this raises a question: can a pure constraint in a derived virtual
class replace an inherited constraint that has an implementation?

I ran into this same issue recently with pure virtual methods.  What
happens if a base virtual class provides an implementation for a
method, and a derived virtual class declares a pure virtual prototype
for that method?

My first reaction was that this was an error.  An implementation was
provided, so this isn't a pure virtual method any more.  But there is
another way it could be treated.  The pure virtual prototype could
override and hide the implementation inherited from the base class.
Any further derived classes would then have to provide an implementation.
This could be useful.  It would allow you to provide an implementation
to some derived classes, but if it was inappropriate for a subset of the
derived classes, you could hide it from those and make them provide one.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Jun 22 11:03:29 2009

This archive was generated by hypermail 2.1.8 : Mon Jun 22 2009 - 11:04:23 PDT