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
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;
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
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;
}
}
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(...)
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?