Parsing string to octal(for umask) at runtime?

Ryan David Sheasby ran27968 at gmail.com
Fri Dec 22 21:36:20 UTC 2017


Hi. Struggling to figure this out. At the bottom of this page: 
https://dlang.org/library/std/conv/octal.html is a vague 
reference to using parse. However, when I use what I would assume 
to be correct based on this: 
https://dlang.org/phobos/std_conv.html#.parse.3 and the fact that 
in the octal page it says octal is also a enum, I see no reason 
this syntax shouldn't work:

import std.conv;

umaskVal = parse!octal(data.umask);

Yet I get an error saying the compiler cannot deduce which 
overload of parse to use... How do I do this parse? Am I going 
about this the wrong way? Is there a better way to parse a string 
as a normal base8 ushort?


More information about the Digitalmars-d-learn mailing list