dynamic classes and duck typing

BCS none at anon.com
Wed Dec 2 09:34:15 PST 2009


Hello Denis,

> What if you don't know argument names a-priori? Consider a generic
> Dynamic  class that has nothing but a single opDispatch method.
> 

you can do whatever logic you want, even (I think) aliasing the function

template opDispatch(string s)
{
     static if(WhateverLogicYouNeed!(s))
           alias Something!(s) opDispatch;
     else
           alias SomethingElse!(s) opDispatch;

}





More information about the Digitalmars-d mailing list