Variadic templates

Knud Sørensen 12tkvvb02 at sneakemail.com
Sat Nov 4 08:20:31 PST 2006


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);



More information about the Digitalmars-d mailing list