Variadic templates
Lionello Lunesu
lio at lunesu.remove.com
Sun Nov 5 23:50:57 PST 2006
Knud Sørensen wrote:
> On Sat, 04 Nov 2006 10:20:37 +0200, Lionello Lunesu wrote:
>
>> Walter Bright wrote:
>>> Knud Sørensen wrote:
>>>> Will something like this be possible ??
>>>>
>>>> tuple t=(7, 'a', 6.8);
>>> Something like that.
>>>
>>>> print at t; // for print(7, 'a', 6.8)
>>> It would be:
>>> print(t);
>> What about the comma operator? It would be perfect for creating tuples,
>> and very consistent with the way functions are called. For example
>> print(7,'a',6.8) passes to tuple (7,'a',6.8) to the function print.
>>
>> L.
>
> Did you mean like this.
> tuple t=7,'a',6.8;
>
> print(t);
Yes, possible needing the () to prevent ambiguity with declaration of
multiple variables.
More information about the Digitalmars-d
mailing list