I am getting this error "Non-const lvalue to type 'Cell' cannot bind to a temporary of type 'Cell *' with this code :
class RegionHolder
{
public:
RegionHolder(Region& Region1):m_RegionCellNOO(&(Region1.m_NOO))
~RegionHolder();
protected:
Cell & m_RegionCellNOO; // difference is here
};
but not with this one :
class RegionHolder
{
public:
RegionHolder(Region& Region1):m_RegionCellNOO(&(Region1.m_NOO))
~RegionHolder();
protected:
Cell * m_RegionCellNOO; // difference is here
};
I don't understand the problem and would really like to use references and not pointers.
Thanks