Ok, I am baffled! I have seen the error "cannot access private member" before, but never "cannot access public member" and I am clueless as to how to fix this ailment!
The error:
My definition of struct Square:Code:C:\Program Files\DevStudio\VC\INCLUDE\utility(14) : error C2248: 'Square::Square' : cannot access public member declared in class 'CMainWnd::Square'
My typedef of ThreatPair:Code:struct Square { int col; int row; Square(int c=-1, int r=-1) : col(c), row(r) { } void Set(int c, int r) { col = c; row = r; } bool isValid() { return col >= 0 && row >= 0; } };
The above error occurs wherever I instantiate a ThreatPair.. I'm simply doing it like this (to try figuring out the error):Code:typedef pair<Square, ThreatSquare> ThreatPair;
And the error points to the line of the default constructor of the pair template in the stl `utility` file... What's going on??? Please assist!Code:ThreatPair tp;



LinkBack URL
About LinkBacks


