xxxxxxxxxx
struct Test
{
float a, b, c, d;
float opIndex(size_t i)
in(i >= 0 && i <= 3)
{
return [this.tupleof][i];
}
float get(size_t i)()
{
return this.tupleof[i];
}
}
void main()
{
auto t = Test(1, 2, 3, 4);
assert(t[3] == 4);
assert(t.get!3 == 4);
}