Question about std.conv.parse

Jacky Jaackky at yopmail.com
Tue Jan 30 09:19:22 UTC 2018


Hello everyone.I'm a newbie on the D language.When i use the 
library 'std.conv' ,i met some problem.
This is what I have:

     static import std.conv;
     string aaa = "123456789";
     uint idx = 5;
     string bbb = aaa[0 .. idx];

     uint work = std.conv.parse!(uint)(bbb); // this works

     uint didnotwork = std.conv.parse!(uint)(aaa[0 .. idx]);   
//but here's a error
     //template std.conv.parse cannot deduce function from 
argument types !(uint)(string)

So my questions are:
1) What is the difference between these two lines?
2) How to correct the second without assign a new variable?

Cheers,
Jacky


More information about the Digitalmars-d-learn mailing list