12 Jul
2012
12 Jul
'12
9:31 a.m.
I am facing the need to get my User Defined Type to return true from
boost::is_arithmetic
You don't, a UDT is not an arithmetic type (according to the type system which is what type_traits honors) it's a class type.
(This is to meet a check for autoprefixing in Boost.Units)
Looks like there are two places this is used in Units - and both are implementation details - for auto-prefixing looks like you need to overload autoprefix_norm for your type. The other use is in is_non_narrowing_conversion, which you would [partially-] specialize for your type. Hope that makes sense, John.