| 5 | #include <ostream> // Caution: do not use import <ostream>; here! |
| 6 | |
| 7 | class Box |
| 8 | { |
| 9 | public: |
| 10 | Box() = default; // In-class definition, and thus implicitly inline |
| 11 | Box(double length, double width, double height); |
| 12 | |
| 13 | // In-class member definitions are implicitly inline |
| 14 | double getLength() const { return m_length; }; |
| 15 | double getWidth() const { return m_width; }; |
| 16 | double getHeight() const { return m_height; }; |
| 17 | |
| 18 | double volume() const; |
| 19 | |
| 20 | private: |
| 21 | double m_length {1.0}; |
| 22 | double m_width {1.0}; |
| 23 | double m_height {1.0}; |
| 24 | }; |
| 25 | |
| 26 | // Out-of-class member definitions must be explicitly marked as inline |
| 27 | inline Box::Box(double length, double width, double height) |
nothing calls this directly
no outgoing calls
no test coverage detected