std.conv.parse for user defined structs/objects
Ilya Yaroshenko
ilyayaroshenko at gmail.com
Fri Dec 27 11:38:59 PST 2013
Hello!
Can we introduce std.conv.parse for user defined structs/classes?
I think we can define inner static method:
-----------
struct UserStruct
{
static typeof(this) parseImpl(Range)(Range range)
if(...)
{
typeof(this) ret;
...
return ret;
}
}
-----------
or something like that.
And then use it in standard parse function.
The reason is common parse, formattedRead and io/stdio.readf
functions that can be used for user defined types (and for
voldemort user defined types too!).
If DIP is preferred in this case, please tell me about.
Best Regards,
Ilya
More information about the Digitalmars-d
mailing list