[Issue 5719] [patch] std.conv.to should support structs with custom converters in addition to objects

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 9 03:43:45 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5719



--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2011-10-09 03:42:53 PDT ---
(In reply to comment #2)
> https://github.com/D-Programming-Language/phobos/pull/118
> https://github.com/D-Programming-Language/phobos/pull/119
> https://github.com/D-Programming-Language/phobos/pull/122

The three pull requests are already merged, and now std.conv.to supports both
two kinds of custom conversions:

1) object to non-object conversion with opCast
   to!T(s)
   --> s.opCast!T()

2) non-object to object conversion with construction
   to!T(s)
   --> new T(s) // if T is class
       T(s)     // if T is struct

Today, is this a closable issue?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list