So I have defined this operator:
constexpr double operator"" _deg(double deg)
{
return deg * M_PI / 180.0L;
}
So far so good. On constants I can now just write:
90.0_deg
But what if we have defined a double and whant to convert it:
double foo = 3.14
How do you call the operator on foo?
I tried:
_deg(foo)
but it says foo is not defined.
Also
operator""(foo)
does obviously not work.
Is it even possible?