Throwing specific Error Obejct for asserts

monarch_dodra monarchdodra at gmail.com
Thu Jan 10 06:31:03 PST 2013


On Thursday, 10 January 2013 at 14:28:44 UTC, bearophile wrote:
> monarch_dodra:
>
>> After:
>> //----
>> auto opSlice(size_t i, size_t j)
>> {
>>    version(assert)
>>        if (i > j)
>>            throw new RangeError();
>> }
>
> But now opSlice can't be nothrow, nor transitively all the code 
> that calls that :-(
>
> Bye,
> bearophile

It can because RangeError is an *Error*.

I actually filed that one, and walter fixed it shortly after. ;)


More information about the Digitalmars-d mailing list