As the title implies, I have a wrapper for a two dimensional array that I want to access by simple saying ColorCluster[X][Y]. But I can't figure out how to overload it. I came up with this idea
But the Select(X,Y) function returns a boolean value. So this approach won't work. I'm sure this has been covered before but I can't seem to find a good article on it. Can anyone help me out?Code:ColorCluster operator [] (int XY) { if (TempCol == 0) { TempCol = XY; return *this; } else { int Buffer = TempCol; TempCol = 0; return Select (Buffer, XY); } };




Reply With Quote