| 2 | #define BOX_H |
| 3 | |
| 4 | class Box |
| 5 | { |
| 6 | public: |
| 7 | // Constructors |
| 8 | Box() = default; |
| 9 | Box(double l, double w, double h) : m_length{l}, m_width{w}, m_height{h} {} |
| 10 | |
| 11 | double volume() const { return m_length * m_width * m_height; } |
| 12 | |
| 13 | // Accessors |
| 14 | double getLength() const { return m_length; } |
| 15 | double getWidth() const { return m_width; } |
| 16 | double getHeight() const { return m_height; } |
| 17 | |
| 18 | bool operator<(const Box& aBox) const // Less-than operator |
| 19 | { return volume() < aBox.volume(); } |
| 20 | |
| 21 | private: |
| 22 | double m_length {1.0}; |
| 23 | double m_width {1.0}; |
| 24 | double m_height {1.0}; |
| 25 | }; |
| 26 | |
| 27 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected