Change struct Rebindable to just use cast() if this is sufficient.

This works better at compiletime.
This commit is contained in:
Mathis Beer 2023-04-18 12:04:06 +02:00 committed by Petar Kirov
parent b818901e63
commit 2f6b2efaf7
2 changed files with 86 additions and 21 deletions

View file

@ -1498,6 +1498,10 @@ if (isInputRange!Range && !isInfinite!Range &&
assert(d.extremum!`a > b` == 10);
assert(d.extremum!(a => a, `a > b`) == 10);
}
// compiletime
enum ctExtremum = iota(1, 5).extremum;
assert(ctExtremum == 1);
}
@nogc @safe nothrow pure unittest