I’m currently updating the Complex Number Exercise according to the Issue 775.
In the Programm Specifications there are some new test that are not there. These tests are about adding a scalar to the complex number (c + 5) and adding a complex number to a scalar (5 + c).
My question now is what would be the better way for this? Overloading of the arithmetic operators but this time as a free friend function like this:
friend Complex operator+(const Complex& complex_number, double scalar);
friend Complex operator+(double scalar, const Complex& complex_number);
or should we stick with the already existing operator overloads and provide a conversion constructor for converting the scalar into an Complex Number with only the real part set?