Well operator<<
is defined to return std::ostream&
:
std::ostream& operator<<(std::ostream& output, const ComplexNumber& z)
^^^^^^^^^^^^^
but you have no return statements, this is undefined behavior and means you can not rely on the behavior of the program, the results are unpredictable. It looks like you should have:
return output ;
at the end of the function. We can see this is undefined behavior from the draft C++ standard section 6.6.3
The return statement paragraph 2 which says:
[...] Flowing off the end of a function is equivalent to a return with no value; this results in undefined behavior in a value-returning function. [...]