On Sunday, 31 December 2017 at 13:47:32 UTC, Adam D. Ruppe wrote:
On Sunday, 31 December 2017 at 13:32:03 UTC, aliak wrote:
So it seems it tries to compile the statements below the check
on V.length even though it's guaranteed to be true and there's
a return statement inside the if.
Yeah,
On Sunday, 31 December 2017 at 13:32:03 UTC, aliak wrote:
So it seems it tries to compile the statements below the check
on V.length even though it's guaranteed to be true and there's
a return statement inside the if.
Yeah, static if includes or excludes code independently at
compile time.
On Sunday, 31 December 2017 at 13:32:03 UTC, aliak wrote:
Alo! I'm making a recursive concat function that is similar to
chain. The following code works:
[...]
I suspect it's because you've no 'else static if'.
Alo! I'm making a recursive concat function that is similar to
chain. The following code works:
import std.range: isInputRange;
auto concat(R, V...)(R range, V values) if (isInputRange!R) {
import std.range: chain, ElementType;
static if (V.length) {
static if