digitalmars.D.learn - can i have a typed tuple?
- dennis luehring (12/12) Aug 30 2007 how can i define the type of an variadic template (tuple)?
- Jarrett Billingsley (5/8) Aug 30 2007 You have to do a static if or static assert. Tuples are very permissive...
- dennis luehring (3/9) Aug 30 2007 thx
- Jarrett Billingsley (3/4) Aug 30 2007 I think you're entitled to whatever opinion you'd like.
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
Aug 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.
Aug 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) ?
Aug 30 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.
Aug 30 2007