Tuple Arguments - Type or Constant?

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Jan 24 21:04:16 PST 2007


"Xinok" <xnknet at gmail.com> wrote in message 
news:ep91ad$sno$1 at 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?) 





More information about the Digitalmars-d mailing list