digitalmars.D - Tuple Arguments - Type or Constant?
- Xinok (4/4) Jan 24 2007 Tuples allow either types or constants to be used as arguments.
- Jarrett Billingsley (6/11) Jan 24 2007 If you use std.typetraits, there is a metafunction isExpressionTuple(). ...
Tuples allow either types or constants to be used as arguments. template tuple(T...); tuple!(int, 35); Is there any way to safely tell if a tuple argument is a type or a constant without getting an error from the compiler?
Jan 24 2007
"Xinok" <xnknet gmail.com> wrote in message news:ep91ad$sno$1 digitaldaemon.com...Tuples allow either types or constants to be used as arguments. template tuple(T...); tuple!(int, 35); Is there any way to safely tell if a tuple argument is a type or a constant without getting an error from the compiler?If you use std.typetraits, there is a metafunction isExpressionTuple(). If that returns true, then it's constants; otherwise, it's, well, I guess any mix of types and expressions. But hopefully just types. (this is kind of an ugly thing with tuples, no?)
Jan 24 2007