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

Function print

Exercises/Modules/Chapter 18/Soln18_05/Soln18_05.cpp:91–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void print(std::ostream& stream, const Customer& customer)
92{
93 stream << customer.toString() << std::endl;
94 if (std::cout.fail())
95 {
96 std::cout.clear();
97 throw std::runtime_error("Failed to output customer");
98 }
99}

Callers 1

mainFunction · 0.70

Calls 2

toStringMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected