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

bls bizprac at orange.fr
Sun Mar 25 15:58:37 PDT 2012


Thanks Artur,

On 03/25/2012 03:18 PM, Artur Skawina wrote:
> 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?...
Not sure...

Maybe if we rename it
fm.list = Values!(1,2,true);

But I does not work..  Seems I am not able to figure out the opDispatch 
signature.

Think I will rewrite it without using opDispatch.

>
> artur



More information about the Digitalmars-d-learn mailing list