--- Comment #12 from Don <> 2011-11-02 17:37:44 PDT ---
(In reply to comment #10)
> (In reply to comment #9)
> > This explicit widening of preconditions of virtual functions seems to be a
> > really niche feature.
> I think it does makes some sense to be like this. You can see it as adding an
> extra method to a derived class, or class implementing an interface. 

Yes. But in those cases you mention, the syntax for accessing the base
functionality is different to the derived functionality. But here we have
something different:

    Derived c;
    Base b = c;; // OK; // fail -- precondition is not widened

Same function body gets used in both calls, BUT different contracts need to get

> The
> derived class adding a new method() still satisfies the interface, in the same
> sense an overriden method accepting wider preconditions still satisfies the
> original precondition, and the interface.

Yes, it does, but why is that desirable? When do you actually want that? Only
in niche cases, I think.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to