I have defined a class Complex
which overloads the +
operator:
Complex operator+(Complex const& x, Complex const& y);
I want to define an implicit conversion from double
to Complex
, such that, for example, if I write c + d
, where c
is a Complex
and d
a double
, it will call my overloaded +
that I defined above and return a Complex
. How can I do this?