oversight with input ranges
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Tue Apr 21 15:48:25 PDT 2015
On Tuesday, April 21, 2015 19:53:47 ketmar via Digitalmars-d wrote:
> here's the interesting oversight for isInputRange:
> https://issues.dlang.org/show_bug.cgi?id=14478
>
> so be careful: ranges with non-copyable elements aren't input ranges for
> now. ;-)
If
auto h = r.front;
doesn't work, then I don't think that it can be a range. And if that means
that elements have to be copyable to be in a range, then I think that
they're going to have to be copyable. There is going to be _way_ too much
code out there that does
auto h = r.front;
for it to work to try and claim that something is an input range when that
line doesn't work. And IIRC, C++ STL containers require that their elements
be copyable in order to work, so it's not like we'd be the first to require
this sort of thing.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list