On Saturday, 8 June 2019 at 21:25:41 UTC, Adam D. Ruppe wrote:
On Saturday, 8 June 2019 at 21:24:53 UTC, Adam D. Ruppe wrote:
_arguments is a compile time construct, it is a run time thing.

err i meant is *NOT* a compile time construct

Thank You for the fast help!

At first I was happy to find the variadic example and didn't even realized, that was the runtime version.

Now it works correctly with the base class check, and also it is now static and fast:

    static foreach(a; args){
      static if(is(typeof(a)==string)){
        //...
      }else
      static if(is(typeof(a) : Cell)){
        if(a !is null){
          //...
        }
      }else
      static if(is(typeof(a)==TextStyle)){
        //...
      }else{
        static assert(0, "Unsupported type: "~typeof(a).stringof);
      }
    }

Reply via email to