Dupping in a nothrow function?

Simen kjaeraas simen.kjaras at gmail.com
Fri Mar 4 14:55:15 PST 2011


bearophile <bearophileHUGS at lycos.com> wrote:

> Simen kjaeraas:
>
>> It's probably correct that _adDupT is not nothrow. It is also wrong
>> that it shouldn't be.
>
> I was about to write a bug report regarding allowing dupping in nothrow  
> functions, because this is now allowed, and I think this is the same  
> thing as doing a dup:
>
>
> nothrow void foo(int[] a) {
>     auto b = new int[a.length];
>     b[] = a[];
> }
> void main() {}

Not sure it's doing the exact same thing, but in essence, it is. It's a
bug, for sure.

-- 
Simen


More information about the Digitalmars-d-learn mailing list