opDispatch(string name, E...) (E e) question.

Artur Skawina art.08.09 at gmail.com
Sun Mar 25 15:18:07 PDT 2012


On 03/25/12 22:45, bls wrote:
> How do I "call" opDispatch(string name, E...)(E elements) ?
> What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using
> 
> fm.list(1, "abc", 4L, 3.33);
> 
> Instead I would prefer
> fm.list = (1, "abc", 4L, 3.33);
> 
> Is this somehow possible ?

Well, you can do

   template ID(A...) { alias A ID; }

   fm.list = ID!(1, "abc", 4L, 3.33);

but is that any better than your first version above?...

artur


More information about the Digitalmars-d-learn mailing list