Template type deduced from struct ctor?

"Luís "Luís
Thu Mar 27 10:42:23 PDT 2014


Could this be made to work?

     struct S(T)
     {
         T x;

         this(T x)
         {
             this.x = x;
         }
     }

     void main()
     {
         int x = 42;
         auto s = S(x); // fails to deduce T
     }


More information about the Digitalmars-d mailing list