Re: Tuples and variable-length template parameter lists

2012-11-06 Thread Joseph Rushton Wakeling
On 11/05/2012 06:14 PM, Simen Kjaeraas wrote: std.typecons.Tuple does a bit of magic behind the scenes. This includes ridding itself of non-type parameters. Simply put, you can imagine inserting the type tuple directly into the function definition: void add(ID id, size_t arg0, real arg1,

Tuples and variable-length template parameter lists

2012-11-05 Thread Joseph Rushton Wakeling
Hello all, Suppose I want to define a tuple type which may have a variable length, e.g.: template Tup(ID, Properties...) { static if(Properties.length == 0) alias Tuple!(ID, id) Tup; else alias

Re: Tuples and variable-length template parameter lists

2012-11-05 Thread Simen Kjaeraas
On 2012-11-05, 15:53, Joseph Rushton Wakeling wrote: Hello all, Suppose I want to define a tuple type which may have a variable length, e.g.: template Tup(ID, Properties...) { static if(Properties.length == 0) alias Tuple!(ID, id)