21 Feb
2013
21 Feb
'13
8:18 p.m.
AMDG On 02/21/2013 12:09 PM, Ryan wrote:
I suppose that it would also be possible to use only the object, and use decltype whenever you need a type.
I tried using the decltype to get the type but got an error. Is this how you meant to use it?
typedef metric::nautical_mile_base_unit::unit_type nautical_mile_unit; static const nautical_mile_unit nautical_mile;
quantity
(2.3 * nautical_mile);
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. In Christ, Steven Watanabe