Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.conv.to for a range #9977

Open
dlangBugzillaToGithub opened this issue May 26, 2013 · 1 comment
Open

std.conv.to for a range #9977

dlangBugzillaToGithub opened this issue May 26, 2013 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

bearophile_hugs reported this on 2013-05-26T06:05:37Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=10175

CC List

Description

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
@dlangBugzillaToGithub
Copy link
Author

bearophile_hugs commented on 2014-03-11T14:23:13Z

*** Issue 12348 has been marked as a duplicate of this issue. ***

@thewilsonator thewilsonator removed OS:Windows Issues Specific to Windows Arch:x86 Issues specific to x86 P4 labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants