'is(T==return)' How does is expression with return keyword as TypeSpecialization

Timoses timosesu at gmail.com
Thu Jul 5 10:32:01 UTC 2018


     int fun(T)(T i)
     {
         static assert(is(typeof(return) == T)); //true
         pragma(msg, is(T == return)); // false
         static if (is(T ReturnType == return))
             pragma(msg, ReturnType); // does not enter
         return i;
     }
     unittest
     {
         fun(3);
     }

What's the purpose of 'is(T == return)' if not the above?


More information about the Digitalmars-d-learn mailing list