Bug 13964 – InputRange!T doesn't have save method

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-10T07:25:00Z
Last change time
2015-01-10T07:41:41Z
Assigned to
nobody
Creator
luis

Comments

Comment #0 by luis — 2015-01-10T07:25:21Z
This fails (due to a lack of a save method?): ``` import std.range; void main() { InputRange!int range = inputRangeObject([1, 2, 3]); auto range2 = range.save(); } ``` /d812/f275.d(6): Error: template std.array.save cannot deduce function from argument types !()(InputRange!int), candidates are: /opt/compilers/dmd2/include/std/array.d(429): std.array.save(T)(T[] a) (http://dpaste.dzfl.pl/bde562b99c5a)
Comment #1 by ketmar — 2015-01-10T07:31:18Z
input ranges are not required to have `.save`. this is forward ranges which are: http://dlang.org/phobos/std_range.html#isForwardRange
Comment #2 by luis — 2015-01-10T07:34:14Z
Nevermind, it's an input range, not a forward or random access range. (I blame the clock!)
Comment #3 by luis — 2015-01-10T07:35:42Z
(In reply to Ketmar Dark from comment #1) > input ranges are not required to have `.save`. this is forward ranges which > are: http://dlang.org/phobos/std_range.html#isForwardRange Right. I do know that, zombie mode... --;;
Comment #4 by ketmar — 2015-01-10T07:41:41Z
so closing it.