mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 13:40:20 +03:00
Introduce a cast as a workaround for missing inout constructors.
This commit is contained in:
parent
8892490584
commit
025c133e34
1 changed files with 7 additions and 1 deletions
|
@ -4421,7 +4421,8 @@ nothrow:
|
|||
|
||||
inout(typeof(this)) opSlice(size_t i, DollarToken) inout
|
||||
{
|
||||
return Cycle(*cast(R*)_ptr, _index + i);
|
||||
// cast: Issue 12177 workaround
|
||||
return cast(typeof(return))Cycle(*cast(R*)_ptr, _index + i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4587,6 +4588,11 @@ unittest //10845
|
|||
assert(equal(cycle(a).take(10), [0, 1, 2, 0, 1, 2, 0, 1, 2, 0]));
|
||||
}
|
||||
|
||||
unittest // 12177
|
||||
{
|
||||
auto a = recurrence!q{a[n - 1] ~ a[n - 2]}("1", "0");
|
||||
}
|
||||
|
||||
private alias lengthType(R) = typeof(R.init.length.init);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue