I was wondering how can you use operators along with 'this'. To put an example:
class grd : clm
{
inline int &operator()(int x, int y) { return g[x][y]; }
/* blah blah blah */
};
grd grd::crop(int cx1, int cy1, int cx2, int cy2)
{
grd ngrd(abs(cx1-cx2), abs(cy1-cy2));
int i, j;
//
for (i = cx1; i < cx2; i++)
{
for (j = cy1; j < cy2; j++)
{
if (i >= 0 && i < x && j >= 0 && j < y)
ngrd(i-cx1,j-cy2) = ?? // this->(i,j); ****
}
}
return ngrd;
}
Thanks!