--- Comment #13 from Leandro Lucarella <llu...@gmail.com> 2011-11-03 07:26:39
(In reply to comment #12)
> (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;
> c.foo(7); // OK
> b.foo(7); // fail -- precondition is not widened
> Same function body gets used in both calls, BUT different contracts need to
I still don't see how that's wrong. I can understand it could be awful to
implement. And I can even agree that it doesn't worth the trouble. But the code
it self makes sense to me.
> > 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.
Yes, that's probably true. But if it's something easy to do, I see the sense on
having the feature. If it's extremely hard I agree it might not worth it.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------