class Complex
{
private:
float re;
float im;
public:
Complex(float r = 0.0, float i = 0.0) : re(r), im(i){}
friend Complex operator+(Complex c1, Complex c2);
};




Complex operator+(Complex c1, Complex c2)
{
return Complex(c1.re + c2.re, c1.im + c2.im);
}



int main()
{
Complex c1(1,2);
Complex c2(1,2);
Complex c3;
c3 = 1.0 + c2;
}



Here is code from example in book and i am curious why does it work shouldn't it show an error in this line c3 = 1.0 + c2 ?