MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / Box

Class Box

Examples/NoModules/Appendix A/ExA_13A/Box.h:7–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <ostream> // Caution: do not use import <ostream>; here!
6
7class Box
8{
9public:
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
20private:
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
27inline Box::Box(double length, double width, double height)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected