I'm running into problems when I try to access a multidemensional array,which is of type stl::vector<stl::vector<controlp>> from a derived class. I've temporarily made the superclass's datamembers public to rule out any problems with data hiding from inheritance.
A derived object crashes with "acces violation" when it tries to perform:
get_no_rows();
which is equivalent to
cpoints.size();
If I declare an object of the base class everything works just fine. It's just the derived object that fails.
I'm very thankful for any advice
the derived class looks like this:
Code:
class Bsurface : public surface
{
public:
Bsurface(){}
Bsurface(int rows, int cols){surface(rows,cols);}
void render_surface();
friend void render_Patch(patch& org, int target_depth);
};
and the base class looks something like this:
Code:
class surface
{
public:
surface(){surface(4,4);}
surface(int rows, int cols);
void render_surface_grid();
void render_cpoints();
int get_no_rows();
int get_no_cols();
// other ctors ....
std::vector<controlp> & operator[](int i)
{
return cpoints[i];
}
const std::vector<controlp> & operator[] (int i) const
{
return cpoints[i];
}
void debug_print();
friend void render_Patch(patch& org, int target_depth);
public:
std::vector<std::vector<controlp> > cpoints;
};