How to partially forward properties of struct array member to struct (disable length property) ?

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 6 03:24:23 PDT 2015


Untested:

     struct Vector(T) {
         T[42] data;

         auto opDispatch(string func, Args...)(Args args)
         if(is(typeof(mixin("data."~func)(Args.init))) && func != 
"length")
         {
             return mixin("data."~func)(Args.init);
         }
     }


More information about the Digitalmars-d-learn mailing list