C ++ 11 is the easiest solution. You could do
static const auto millimeter = milli * meter;
or
auto operator"" _mm (long double val) -> decltype(val * milli * meter) { return val * milli * meter; }
There should be no performance penalty if you do not convert to other prefixes. And even if you do, it must be careless.
If you do not want to use C ++ 11, you will need to find the appropriate type of expression milli * meter , although you could just replace auto with int and read the compiler message.
filmor
source share