Places a TypeTuple can be used
Ali Çehreli
acehreli at yahoo.com
Thu Aug 15 21:14:03 PDT 2013
I know of three places a TypeTuple can be used at:
1) Function parameter list
2) Template parameter list
3) Array literal element list
Are there more?
import std.typetuple;
void foo(int, string, double)
{}
struct S(T, float f)
{}
void main()
{
// 1) Function parameter list: May not contain types
foo(TypeTuple!(42, "hello", 1.5));
// 2) Template parameter list: May contain types
auto s = S!(TypeTuple!(char, 2.5))();
// 3) Array elements: Elements must be the same type
auto a = [ TypeTuple!(1, 2, 3, 4) ];
// Are there other places that a TypeTuple can be used?
}
Ali
More information about the Digitalmars-d-learn
mailing list