| 100 | } |
| 101 | |
| 102 | void 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 | } |