diff -r dcee1338df33 boost/numeric/ublas/traits.hpp --- a/boost/numeric/ublas/traits.hpp Tue Sep 29 15:01:07 2009 -0400 +++ b/boost/numeric/ublas/traits.hpp Fri Oct 09 08:50:15 2009 -0400 @@ -26,6 +26,8 @@ #include #include #include +#include +#include // anonymous namespace to avoid ADL issues namespace { @@ -43,43 +45,83 @@ namespace boost { namespace numeric { namespace ublas { - template - typename boost::enable_if, std::complex >::type inline operator+ (int in1, std::complex const& in2 ) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator+ (I in1, std::complex const& in2 ) { return R (in1) + in2; } - template - typename boost::enable_if, std::complex >::type inline operator+ (std::complex const& in1, int in2) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator+ (std::complex const& in1, I in2) { return in1 + R (in2); } - template - typename boost::enable_if, std::complex >::type inline operator- (int in1, std::complex const& in2) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator- (I in1, std::complex const& in2) { return R (in1) - in2; } - template - typename boost::enable_if, std::complex >::type inline operator- (std::complex const& in1, int in2) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator- (std::complex const& in1, I in2) { return in1 - R (in2); } - template - typename boost::enable_if, std::complex >::type inline operator* (int in1, std::complex const& in2) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator* (I in1, std::complex const& in2) { return R (in1) * in2; } - template - typename boost::enable_if, std::complex >::type inline operator* (std::complex const& in1, int in2) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator* (std::complex const& in1, I in2) { return in1 * R(in2); } - template - typename boost::enable_if, std::complex >::type inline operator/ (int in1, std::complex const& in2) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator/ (I in1, std::complex const& in2) { return R(in1) / in2; } - template - typename boost::enable_if, std::complex >::type inline operator/ (std::complex const& in1, int in2) { + template + typename boost::enable_if< + mpl::and_< + boost::is_float, + boost::is_integral + >, + std::complex >::type inline operator/ (std::complex const& in1, I in2) { return in1 / R (in2); }