Testing implicit conversion to template instance with is() expression

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 15 08:47:49 PDT 2015


Should this work?

     struct V(string s) {
     }

     struct S(int U) {
         V!"xyz" x;
         alias x this;
     }

     void main() {
         S!10 a;
         static assert(is(a : V!Args, Args...));
     }

With DMD Git master, the static assert() fails. Should it? Am I 
doing something wrong? How can I test whether something is 
implicitly convertible to any instance of a particular template?


More information about the Digitalmars-d-learn mailing list