| 4 | #include "DimensionError.h" |
| 5 | |
| 6 | class Box |
| 7 | { |
| 8 | public: |
| 9 | Box(double l, double w, double h) : m_length{ l }, m_width{ w }, m_height{ h } |
| 10 | { |
| 11 | if (l <= 0.0 || w <= 0.0 || h <= 0.0) |
| 12 | throw DimensionError{ std::min({l, w, h}) }; |
| 13 | } |
| 14 | |
| 15 | double volume() const { return m_length * m_width * m_height; } |
| 16 | private: |
| 17 | double m_length{ 1.0 }; |
| 18 | double m_width{ 1.0 }; |
| 19 | double m_height{ 1.0 }; |
| 20 | }; |
| 21 | |
| 22 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected