Shouldn't __traits return Tuples?

Max Samukha samukha at voliacable.com.removethis
Wed Apr 1 12:26:26 PDT 2009


On Wed, 01 Apr 2009 20:54:12 +0200, Trass3r <mrmocool at gmx.de> wrote:

>template Sequence(size_t count, size_t index = 0)
>{
>    static if (index < count)
>       alias Tuple!(index, Sequence!(count, index + 1)) Sequence;
>}

There was ellipsis to suggest that you should terminate the recursion
properly :) Sorry

template Sequence(size_t count, size_t index = 0)
{
    static if (index < count)
       alias Tuple!(index, Sequence!(count, index + 1)) Sequence;
   else
       alias Tuple!() Sequence;
}



More information about the Digitalmars-d mailing list