WTF does "Enforcement failed" actually mean?
John Colvin via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Oct 1 01:52:43 PDT 2015
On Thursday, 1 October 2015 at 07:08:00 UTC, Russel Winder wrote:
> On Wed, 2015-09-30 at 23:35 -0700, Ali Çehreli via
> Digitalmars-d-learn wrote:
>> On 09/30/2015 10:46 PM, Russel Winder via Digitalmars-d-learn
>> wrote:
>> > [...]
>>
>> It's coming from the following no-message enforce():
>>
>> enforce(!r.empty);
>>
>>
>> https://github.com/D-Programming-Language/phobos/blob/master/std/algo
>> rithm/iteration.d#L2481
>>
>> You are using the no-seed version of reduce(), which uses the
>> first element as seed, which means that the range cannot be
>> empty.
>
> Well that explanation (*) makes it abundantly clear that the
> error reporting from this part of Phobos is distinctly
> substandard, let alone below par.
>
>
> (*) Which is clear and informative!
Bug report? Then it'll get fixed.
More information about the Digitalmars-d-learn
mailing list