[Issue 15687] isInputRange/isForwardRange discriminate against void[]

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Feb 15 07:26:09 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15687

--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
I think the main reason is that void[] cannot have valid `front` property as a
Range.
In std.range.primitive:

@property ref T front(T)(T[] a) @safe pure nothrow @nogc
if (!isNarrowString!(T[]) && !is(T[] == void[]))
{ ... }

@property dchar front(T)(T[] a) @safe pure if (isNarrowString!(T[]))
{ ... }

The template constraint of `popFront` would just follow the `front`'s.

--


More information about the Digitalmars-d-bugs mailing list