I have a Rectangle
class with conversion operators to both double
and std::string
:
class Rectangle
{
public:
Rectangle
There is nothing special about double-overloading than other primitive types overloadings. In this case, it is the only primitive overload available. The compiler will behave the same for int, char, etc..
Notice that if we would have more than one primitive type overload the compiler will throw
error: ambiguous overload for 'operator<<' ...