#include class Rectangle { Rectangle(float width, float height) : width{width}, height{height} { if (width / height < 2 || height / width < 2) { throw std::logic_error("unresonable side difference"); } } void rotate_90() { float tmp {width}; width = height; height = tmp; } bool operator<(Rectangle const& rhs) const { float left_area { width * height }; float right_area { rhs.width * rhs.height }; return left_area < right_area; } private: float width; float height; };