DMD 1.027 and 2.011 releases

Ary Borenszweig ary at esperanto.org.ar
Wed Feb 27 01:40:03 PST 2008


eao197 escribió:
>> eao197 wrote:
> I'm affraid that you misunderstand my point. When you use a[i] or new in 
> nothrow function you always known what could happen. But if you call 
> virtual method from any object you can't predict its behaviour. Because 
> the method implementation in some derived class could define contract 
> for that method. And you may don't known about it.
> 
> And becouse of this I think that 'nothrow' is a kind of function 
> contract. And if a function defines such contract then it can't redefine 
> it in derived classes.

But contracts are predictable. Say B extends A, and A has a foo method. 
If foo says nothrow, than if B overrides foo, it must also be nothrow 
(this will be enforced by the compiler, I'm sure).

For in and out, http://www.digitalmars.com/d/1.0/dbc.html shows there 
will be no problem.


More information about the Digitalmars-d-announce mailing list