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

Function print

Exercises/Modules/Chapter 18/Soln18_03/Soln18_03.cpp:102–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void print(std::ostream& stream, const Customer& customer)
103{
104 stream << customer.toString() << std::endl;
105 if (std::cout.fail())
106 {
107 std::cout.clear();
108 throw std::runtime_error("Failed to output customer");
109 }
110}

Callers 1

mainFunction · 0.70

Calls 2

toStringMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected