If a function returns a lazy range, I can't verify its correctness in the function post-condition because inside the post-condition such range is const.

An example of the problem:


import std.range, std.algorithm;

auto foo()
out(result) {
    assert(result.all!(x => x < 10));
} body {
    return iota(5);
}

void main() {}


This limits the usefulness of post-conditions in my code. Do you have ideas to solve this problem?

Bye,
bearophile

Reply via email to