error C2248: 'Graph_lib::Shape::Shape' : cannot access private member declared in class 'Graph_lib::Shape'
Here is the main loop
int main()
{
Point tl(100,100); //top left corner of window
Simple_window win(tl,400,400,"My Window");
vector<Rectanglee> rects; //Here is where I think the problem lies.
for (int i=0;i<8;i++){
int xa=(i*50)-1;
for(int j=0;j<8;j++){
int ya=(j*50)-1;
Rectanglee rect(Point(i,j),50,50);
rects.push_back(rect);
}
}
for(int i=0;i<64;i++){
win.attach(rects); //attach rect to screen
}
win.wait_for_button(); //wait until user clicks the next button to close window
}
Here is the rectanglee struct.
struct Rectanglee : Shape {
Rectanglee(Point xy, int ww, int hh) : w(ww), h(hh)
{
add(xy);
if (h<=0 || w<=0) error("Bad rectangle: non-positive side");
}
Rectanglee(Point x, Point y) : w(y.x-x.x), h(y.y-x.y)
{
add(x);
if (h<=0 || w<=0) error("Bad rectangle: non-positive width or height");
}
void draw_lines() const;
int height() const { return h; }
int width() const { return w; }
private:
int h; // height
int w; // width
};