Should this invariant always hold? equal(range.retro.array, range.array.retro)

FeepingCreature feepingcreature at gmail.com
Mon Oct 17 12:07:40 UTC 2022


On Monday, 17 October 2022 at 11:46:35 UTC, ag0aep6g wrote:
> On Monday, 17 October 2022 at 11:02:07 UTC, FeepingCreature 
> wrote:
>> Trolling a bit: Should this invariant always hold?
>>
>> assert(equal(range.retro.array, range.array.retro));
>
> No, it shouldn't. The first expression might consume `range`. 
> So it might be empty in the second expression.

Ah, good idea!

assert(equal(range.save.retro.array, range.save.array.retro));


More information about the Digitalmars-d mailing list