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

Function print

Exercises/NoModules/Chapter 18/Soln18_04/Soln18_04.cpp:94–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 2

toStringMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected