mirror of
https://github.com/dlang/phobos.git
synced 2025-05-01 15:40:36 +03:00
Only define Until.save() forward ranges
std.algorithm.Until.save() was defined for all ranges, but should only be defined when the underlying range is a forward range.
This commit is contained in:
parent
3b628aeb50
commit
dc352eaec9
1 changed files with 22 additions and 19 deletions
|
@ -3655,29 +3655,32 @@ struct Until(alias pred, Range, Sentinel) if (isInputRange!Range)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static if (!is(Sentinel == void))
|
static if (isForwardRange!Range)
|
||||||
@property Until save()
|
{
|
||||||
{
|
static if (!is(Sentinel == void))
|
||||||
Until result;
|
@property Until save()
|
||||||
|
{
|
||||||
|
Until result;
|
||||||
|
|
||||||
result._input = _input.save;
|
result._input = _input.save;
|
||||||
result._sentinel = _sentinel;
|
result._sentinel = _sentinel;
|
||||||
result._openRight = _openRight;
|
result._openRight = _openRight;
|
||||||
result._done = _done;
|
result._done = _done;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@property Until save()
|
@property Until save()
|
||||||
{
|
{
|
||||||
Until result;
|
Until result;
|
||||||
|
|
||||||
result._input = _input.save;
|
result._input = _input.save;
|
||||||
result._openRight = _openRight;
|
result._openRight = _openRight;
|
||||||
result._done = _done;
|
result._done = _done;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Ditto
|
/// Ditto
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue