digitalmars.D - Tuple Arguments - Type or Constant?
- Xinok <xnknet gmail.com> Jan 24 2007
- "Jarrett Billingsley" <kb3ctd2 yahoo.com> Jan 24 2007
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








"Jarrett Billingsley" <kb3ctd2 yahoo.com>