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

Reply via email to