[Issue 10006] Implicit conversion in initializers doesn't work for subtypes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 29 03:32:29 PDT 2013


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



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-04-29 03:32:28 PDT ---
This does give me an idea for a DIP:

struct S
{
    float value = 0.0;
    alias value this;

    // called only when a *literal* is provided
    this(enum double val) { }
}

This would enable creating custom implicit conversions when initializing a
struct with a literal of some sort.

-- 
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