Thread overview
can i have a typed tuple?
Aug 30, 2007
dennis luehring
Aug 30, 2007
dennis luehring
August 30, 2007
how can i define the type of an variadic template (tuple)?

item!(uint) test1;
item!(int) tes2t;
item!(double) test3;
int test4;

item_list!( test1, test2, test3, test4 );

item_list sould be an variadic template of items
so test4 should fail to compile (because its no item)

should i do a static if test in my item_list template or can i limit the allowed type in the item_list interface?

"variadic list of this type"

ciao dennis





August 30, 2007
"dennis luehring" <dl.soluz@gmx.net> wrote in message news:fb6dbm$2bgr$1@digitalmars.com...
> should i do a static if test in my item_list template or can i limit the allowed type in the item_list interface?
>
> "variadic list of this type"

You have to do a static if or static assert.  Tuples are very permissive, and don't really offer any way to restrict what kinds of things can be passed to them.


August 30, 2007
Jarrett Billingsley Wrote:

> > should i do a static if test in my item_list template or can i limit the allowed type in the item_list interface? "variadic list of this type"

> You have to do a static if or static assert.  Tuples are very permissive, and don't really offer any way to restrict what kinds of things can be passed to them.

thx

should tuples offer more restrictions (optional) ?



August 31, 2007
"dennis luehring" <dl.soluz@gmx.net> wrote in message news:fb6ua0$3jm$1@digitalmars.com...

> should tuples offer more restrictions (optional) ?

I think you're entitled to whatever opinion you'd like.