struct A {
float* n;
int d;
float operator()(int x, int y) const;
float& operator()(int x, int y);
};
float A::operator()(int x, int y) const
{
return n[y * d + x];
}
float& A::operator()(int x, int y)
{
return n[y * d + x];
}
void main()
{
A a;
// ... initialize A''s memebers ...
a(2, 4) = 32; //<- both produce the "term does not evaluate to function" error when compiling
float c = a(2, 4);
}
Can anyone spot a mistake?