Rectangle::Rectangle(Point _pLeftUp, Point _pRightDown) : m_pLU(_pLeftUp), m_pRD(_pRightDown) { m_pLD.m_x = m_pLU.m_x; //<-- Error! if (m_pRD.m_x < m_pLU.m_x || m_pLU.m_y < m_pRD.m_y) throw std::logic_error("Invalid rectangle coordinates"); } 

m_pLD , m_pLU , m_pRD , m_pRU are structures at the corners of a quadrilateral. Point and Rectangle have private access specifier. Const near m_pLD , m_pLU , m_pRD and m_pRU not worth it.

  • one
    What is m_pLD? - n3r0bi0m4n
  • How do you describe the types Point and Rectangle? - Harry
  • 2
    Vanghua, that there is a const Point m_pLD, m_pLU - int3
  • @Sergey make changes to the question via the link edit question. In the comments of the essential part is not worth writing. - αλεχολυτ
  • Give the full definitions of Point and Rectangle . What is m_x ? - AnT

0