Template Tuple Defaults
Simen Kjaeraas
simen.kjaras at gmail.com
Sun Mar 30 04:44:15 PDT 2008
On Sun, 30 Mar 2008 06:06:00 +0200, Peter Neubauer
<peterneubauer2 at gmail.com> wrote:
> Is there a way to give default types to template tuple parameters?
> Like this:
>
>
> class Test (TTuple ... = [char, int] )
> {
> // ...
> }
>
> void main ()
> {
> Test t; // Equivalent to Test !(char, int) t;
> }
>
>
> Obviously, that does not compile.
>
> Thanks in advance,
> -Peter
This oughtta work (does on my confuser).
import std.typetuple;
class Test (TTuple ... = TypeTuple!(char, int) )
{
// ...
}
void main ()
{
Test t; // Equivalent to Test !(char, int) t;
}
-- Simen
More information about the Digitalmars-d-learn
mailing list