
AMDG On 12/15/2010 11:10 AM, alfC wrote:
The ability to test for a conversion is liable to result in ODR problems. On the other hand, the errors are pretty horrendous right now. I am not sure how ODR applies here.
is_convertible would depend on which headers are #included. This makes ODR violations really easy.
But I guess a compile time check will have the same limitations are the conversion itself. After all in the same way the constructor
quantity1(q2) is defined, so should be an hypothetical is_convertible<quantity1, quantity2>::static_value.
Just a though: for example, can the BOOST_UNITS_DEFINE_CONVERSION_FACTOR add some kind of is_convertible trait at the same time? (I know, it won't be useful for derived conversions).
In Christ, Steven Watanabe