Summary: [] constructing conversion doesn't work
                    with alias this
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Kenji Hara <> 2012-06-18 22:28:24 PDT ---

This kind conversions should be possible with

import std.conv;
struct Wrap
    string wrap;
    alias wrap this;
void main()
    Wrap[] y = to!(Wrap[])(["foo", "bar"]);  // shold work

If you can construct Wrap object with the syntax Wrap("foo"), runs 'conversion by construction'.
And if S is convertible to T,!(T[])(S[] source) runs 
'element-wise array conversion'.
As a result, string[] to Wrap[] will be converted.

...but, this does not work in 2.060head, it is a bug.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to