oversight with input ranges

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 22 12:13:08 PDT 2015


On Wed, 22 Apr 2015 18:32:55 +0000, Jesse Phillips wrote:

> On Wednesday, 22 April 2015 at 05:31:03 UTC, ketmar wrote:
>> many algorithms in std.algo doesn't copy if you'll use `(ref a)`
>> labmdas.
> 
> I understand that, but the compiler won't complain "hey that isn't valid
> for all input ranges!" when it sees that someone copied front.

yes, that's why introducing new trait is better. i was trying to minify 
support burden with changes to `isInputRange`, yet it seems to bring more 
problems that it is intended to solve, and i was wrong.

but i still believe that allowing "proxying algos" work on such 
"restriced" ranges is a viable addition. think about `Unique`, for 
example, as Peter noted in bugzilla.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150422/bea7d0fd/attachment.sig>


More information about the Digitalmars-d mailing list