Re: std.conv.parse for user defined structs/objects

2014-01-19 Thread Dmitry Olshansky
06-Jan-2014 08:19, H. S. Teoh пишет: On Fri, Dec 27, 2013 at 08:43:25PM +, Ilya Yaroshenko wrote: I've been thinking about this too. It shouldn't be too hard to add this to std.conv (I'd call it fromString, though, by analogy with toString -- parseImpl looks a bit ugly). Is fromString

Re: std.conv.parse for user defined structs/objects

2014-01-06 Thread Jacob Carlborg
On 2013-12-27 20:38, Ilya Yaroshenko wrote: 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;

Re: std.conv.parse for user defined structs/objects

2014-01-05 Thread H. S. Teoh
On Fri, Dec 27, 2013 at 08:43:25PM +, Ilya Yaroshenko wrote: I've been thinking about this too. It shouldn't be too hard to add this to std.conv (I'd call it fromString, though, by analogy with toString -- parseImpl looks a bit ugly). Is fromString good in case of InputRange? Good

std.conv.parse for user defined structs/objects

2013-12-27 Thread Ilya Yaroshenko
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; } }

Re: std.conv.parse for user defined structs/objects

2013-12-27 Thread H. S. Teoh
On Fri, Dec 27, 2013 at 07:38:59PM +, Ilya Yaroshenko wrote: 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(...)

Re: std.conv.parse for user defined structs/objects

2013-12-27 Thread Ilya Yaroshenko
I've been thinking about this too. It shouldn't be too hard to add this to std.conv (I'd call it fromString, though, by analogy with toString -- parseImpl looks a bit ugly). Is fromString good in case of InputRange?