I tried to use std.conv.parse(args[2])
,
import std.stdio;
import std.conv;
void main(string[] args){
if (args.length > 1) {
writeln(broadcastSettingChange(args[1]));
if (args.length == 2) {
// TODO: second argument needs parse to uint
writeln(broadcastSettingChange(args[1], std.conv.parse(args[2])));
}
} else {
writeln(broadcastSettingChange());
}
write(args.length > 1);
}
But I'm getting this error
(21): Error: template `std.conv.parse` cannot deduce function from argument types `!()(string)`
.\..\..\src\phobos\std\conv.d(2263): Candidates are: `parse(Target, Source, Flag doCount = No.doCount)(ref Source source)`
.\..\..\src\phobos\std\conv.d(2382): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s)`
.\..\..\src\phobos\std\conv.d(2804): `parse(Target, Source, Flag doCount = No.doCount)(ref Source source, uint radix)`
.\..\..\src\phobos\std\conv.d(2973): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s)`
.\..\..\src\phobos\std\conv.d(3084): `parse(Target, Source, Flag doCount = No.doCount)(ref Source source)`
.\..\..\src\phobos\std\conv.d(3776): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s)`
.\..\..\src\phobos\std\conv.d(3833): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s)`
.\..\..\src\phobos\std\conv.d(3918): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s)`
.\..\..\src\phobos\std\conv.d(4031): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',')`
.\..\..\src\phobos\std\conv.d(4218): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar comma = ',')`
.\..\..\src\phobos\std\conv.d(4327): `parse(Target, Source, Flag doCount = No.doCount)(ref Source s, dchar lbracket = '[', dchar rbracket = ']', dchar keyval = ':', dchar comma = ',')`
WM_SETTINGCHANGE.d(21): All possible candidates are marked as `deprecated` or `@disable`
Failed: ["C:\\Users\\Windows10\\Desktop\\dmd2\\windows\\bin\\dmd.exe", "-v", "-o-", "WM_SETTINGCHANGE.d", "-I."]