---- import std.stdio; struct A { void opIndex(T)(size_t index) { } }
void main() { A a; a.opIndex!int(0); // [1] a!int[0]; // [2] } ---- [1] works, but [2] fails.How can I call opIndex with bracket syntax and a typename? Or is this not possible?
---- import std.stdio; struct A { void opIndex(T)(size_t index) { } }
void main() { A a; a.opIndex!int(0); // [1] a!int[0]; // [2] } ---- [1] works, but [2] fails.How can I call opIndex with bracket syntax and a typename? Or is this not possible?