Yes, that's what I meant, but now that I see it written
out, it's wrong because decltype keeps the const qualifier.
You need the behavior of the non-standard typeof operator.
BOOST_TYPEOF should work.
quantity<BOOST_TYPEOF(nautical_mile)>(2.3 * nautical_mile);
I tried this and it works. Is there a method, template or macro that lets me create the following two line like BOOST_UNITS_STATIC_CONSTANT?
typedef metric::nautical_mile_base_unit::unit_type nautical_mile_unit;
static const nautical_mile_unit nautical_mile;
That way I don't have to create a name for the type and only use BOOST_TYPEOF if I need the type from the global constant.
Ryan