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

Function print

Exercises/Modules/Chapter 16/Soln16_06/Soln16_06.cpp:113–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void print(std::ostream& stream, const Customer& customer)
114{
115 stream << customer.toString() << std::endl;
116 if (std::cout.fail())
117 {
118 std::cout.clear();
119 throw std::runtime_error("Failed to output customer");
120 }
121}

Callers 1

mainFunction · 0.70

Calls 2

toStringMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected