
"David Abrahams" <dave@boost-consulting.com> wrote
"Andy Little" <andy@servocomm.freeserve.co.uk> writes:
If so ... Is this not a lurking bug waiting to happen?
No, why?
Note however that run_time numeric_cast Source parameter would not be deducible if changed, I think.
??
Other similar inconsistency is (I think) is_convertible).
Specifically?
#include "boost/numeric/converter.hpp" #include "boost/type_traits/is_convertible.hpp" #include <complex> #include <cassert> template<typename Target, typename Source> Target do_conv( Source const & s) { typedef boost::numeric::converter<Target,Source> conv; assert((boost::is_convertible<Target,Source>::value) ); typedef conv::result_type result_type; result_type res = conv()(s); return res; } int main() { do_conv<int>(2.); /* once a year*/ do_conv<std::complex<double> >(2.); } regards Andy Little