A double&
has to refer to a double, and myint
is not a double. You’re actually building a temporary double and constructing a const double&
to the temporary.
A double&
has to refer to a double, and myint
is not a double. You’re actually building a temporary double and constructing a const double&
to the temporary.