Fix foldr scope
This commit is contained in:
parent
c7bfbe0657
commit
cfcb1e727a
@ -226,7 +226,7 @@ if (F.length == 1)
|
||||
*
|
||||
* Returns: Accumulated value.
|
||||
*/
|
||||
auto foldr(R, T)(R range, auto ref T init)
|
||||
auto foldr(R, T)(scope R range, scope return auto ref T init)
|
||||
if (isBidirectionalRange!R)
|
||||
{
|
||||
if (range.empty)
|
||||
|
@ -177,9 +177,7 @@ if (isInputRange!Range && hasLvalueElements!Range)
|
||||
import tanya.memory.op : copy, fill;
|
||||
alias T = ElementType!Range;
|
||||
|
||||
static if (__VERSION__ >= 2083
|
||||
&& isDynamicArray!Range
|
||||
&& __traits(isZeroInit, T))
|
||||
static if (isDynamicArray!Range && __traits(isZeroInit, T))
|
||||
{
|
||||
fill!0(range);
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ unittest
|
||||
}
|
||||
|
||||
// Typeid
|
||||
nothrow pure @safe unittest
|
||||
nothrow @safe unittest
|
||||
{
|
||||
assert(format!"{}"(typeid(int[])) == "int[]");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user