Consider the following code

---------
import std.range;
import std.conv;
import std.utf;
import std.algorithm;

auto test(R)(R s)
{
    auto value = s.byCodeUnit;
    auto splitValue = value.splitter('.');
    parse!int(splitValue.front);
}

void main()
{
    test("1.8");
}
---------

This fails to compile and I can't for the life of me understand why. The std.conv.parse call doesn't match any parse overload when it should match the second one:

---------
std.conv.parse(Target, Source)(ref Source s) if (
isSomeChar!(ElementType!Source) && isIntegral!Target && !is(Target == enum))
---------

Manually verifying the template constraints proves that it should work,

---------
pragma(msg, isSomeChar!(ElementType!(typeof(splitValue.front))), isIntegral!int, !is(int == enum));

truetruetrue
---------

Any help here would be appreciated.

Reply via email to