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

Method Box

Examples/NoModules/Chapter 12/Ex12_05/Ex12_05.cpp:20–24  ·  view source on GitHub ↗

A constructor that initializes all three member variables

Source from the content-addressed store, hash-verified

18
19// A constructor that initializes all three member variables
20Box::Box(double length, double width, double height)
21 : m_length{length}, m_width{width}, m_height{height}
22{
23 std::cout << "Box constructor 1 called." << std::endl;
24}
25
26// This second constructor forwards to the first one to initialize all members.
27// Note that you do not repeat the explicit keyword here!

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected