Weird template error in Phobos (after editing) that I can't quite get. Compiler bug?
Atila Neves via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Mar 22 07:10:22 PDT 2017
On Wednesday, 22 March 2017 at 14:06:56 UTC, Atila Neves wrote:
> isInputRange looks like this:
>
> template isInputRange(R)
> {
> enum bool isInputRange = is(typeof(
> (inout int = 0)
> {
> R r = R.init; // can define a range object
> if (r.empty) {} // can test for empty
> r.popFront; // can invoke popFront()
> auto h = r.front; // can get the front of the range
> }));
> }
>
> [...]
Got the same error when I changed it to:
enum isInputRange(R) = is(typeof({...}));
Which might explain why it's still inside an explicit template
declaration. Or not, this whole thing is weird to me.
Atila
More information about the Digitalmars-d-learn
mailing list