← Back to index
|
Original Bugzilla link
Bug 10175 – std.conv.to for a range
Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-05-26T06:05:37Z
Last change time
2024-12-01T16:17:40Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: phobos#9977 →
Comments
Comment #0
by bearophile_hugs — 2013-05-26T06:05:37Z
This is borderline between an enhancement and a bug report. import std.array: array; import std.range: iota; import std.conv: to; void main() { auto items = iota(10); auto r1 = items.array.to!(string[]); auto r2 = items.to!(string[]); } DMD 2.063beta7 gives: ...\dmd2\src\phobos\std\conv.d(276): Error: template std.conv.toImpl does not match any function template declaration. Candidates are: ...\dmd2\src\phobos\std\conv.d(332): std.conv.toImpl(T, S)(S value) if (isImplicitlyConvertible!(S, T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) ...\dmd2\src\phobos\std\conv.d(445): std.conv.toImpl(T, S)(ref S s) if (isRawStaticArray!(S)) ...\dmd2\src\phobos\std\conv.d(461): std.conv.toImpl(T, S)(S value) if (is(typeof(S.init.opCast!(T)()) : T) && !isExactSomeString!(T)) ...\dmd2\src\phobos\std\conv.d(492): std.conv.toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && is(T == struct) && is(typeof(T(value)))) ...\dmd2\src\phobos\std\conv.d(542): std.conv.toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && is(T == class) && is(typeof(new T(value)))) ...\dmd2\src\phobos\std\conv.d(276): ... (16 more, -v to show) ... ...\dmd2\src\phobos\std\conv.d(332): Error: template std.conv.toImpl cannot deduce template function from argument types !(string[])(Result) ...\dmd2\src\phobos\std\conv.d(276): Error: template instance toImpl!(string[]) errors instantiating template test.d(7): Error: template instance std.conv.to!(string[]).to!(Result) error instantiating
Comment #1
by bearophile_hugs — 2014-03-11T14:23:13Z
*** Issue 12348 has been marked as a duplicate of this issue. ***
Comment #2
by robert.schadek — 2024-12-01T16:17:40Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/phobos/issues/9977
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB