std.conv.parse not accepting ByCodeUnitImpl

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 25 11:43:05 PDT 2016


On 5/25/16 2:23 PM, Jack Stouffer wrote:
> On Wednesday, 25 May 2016 at 16:53:30 UTC, Steven Schveighoffer wrote:
>> to should work wherever parse works (in fact, whenever you call
>> to!someType(someString), I believe it just forwards to parse).
>
> This is not the case; to doesn't work with ranges:
>
>      auto str = "1234567".byCodeUnit;
>      auto result = parse!int(str);
>      auto result2 = to!int(str); // doesn't compile
>

If parse can do it, to should as well.

I think it's a question of how the template constraints are done. Please 
file an issue.

-Steve


More information about the Digitalmars-d-learn mailing list