[Issue 1997] Better type inference for templated types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 16 08:17:36 PDT 2011


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



--- Comment #2 from Simen Kjaeraas <simen.kjaras at gmail.com> 2011-09-16 08:17:12 PDT ---
It is worth noting here that the workaround is to use a free function:

struct Foo( T ) {
    T data;
    this( T value ) {
        data = value;
    }
}

Foo!T foo( T )( T value ) {
    return Foo!T( value );
}

void main( ) {
    foo( 4 );
}

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