digitalmars.D.learn - enum tuple subscript as template parameter => Tuple(A(0)) must be an
- bastien penavayre (18/18) May 07 2017 Hi,
Hi, I'm having a bit of an issue here and the compiler is not really explicit. Here's the code: import std.typecons; struct A { int i; } void main() { enum t = tuple(A()); f!(t[0].i); //Error: Tuple(A(0)) must be an array or pointer type, not Tuple!(A) f!((&t[0]).i) //Ok enum v = t[0]; f!(v.i); //Error: template instance f!(i) does not match template declaration f(int T)() f!((v.i)); //Ok } void f(int T)() {}
May 07 2017