Ticket #4441: enable_if_sfinae.patch
File enable_if_sfinae.patch, 3.5 KB (added by , 12 years ago) |
---|
-
matrix_expression.hpp
2940 2940 // (t * m) [i] [j] = t * m [i] [j] 2941 2941 template<class T1, class E2> 2942 2942 BOOST_UBLAS_INLINE 2943 typename enable_if< is_convertible<T1, typename E2::value_type >, 2944 typename matrix_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::result_type 2945 >::type 2943 typename matrix_binary_scalar1_traits<const typename boost::enable_if_c<boost::is_arithmetic<T1>::value, T1>::type, E2, scalar_multiplies<T1, typename E2::value_type> >::result_type 2946 2944 operator * (const T1 &e1, 2947 2945 const matrix_expression<E2> &e2) { 2948 2946 typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::expression_type expression_type; … … 3375 3373 // (m * t) [i] [j] = m [i] [j] * t 3376 3374 template<class E1, class T2> 3377 3375 BOOST_UBLAS_INLINE 3378 typename enable_if< is_convertible<T2, typename E1::value_type>, 3379 typename matrix_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::result_type 3380 >::type 3376 typename matrix_binary_scalar2_traits<E1, const typename boost::enable_if_c<boost::is_arithmetic<T2>::value, T2>::type, scalar_multiplies<typename E1::value_type, T2> >::result_type 3381 3377 operator * (const matrix_expression<E1> &e1, 3382 3378 const T2 &e2) { 3383 3379 typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::expression_type expression_type; -
vector_expression.hpp
15 15 16 16 #include <boost/numeric/ublas/expression_types.hpp> 17 17 18 19 18 // Expression templates based on ideas of Todd Veldhuizen and Geoffrey Furnish 20 19 // Iterators based on ideas of Jeremy Siek 21 20 // … … 1170 1169 // (t * v) [i] = t * v [i] 1171 1170 template<class T1, class E2> 1172 1171 BOOST_UBLAS_INLINE 1173 typename enable_if< is_convertible<T1, typename E2::value_type >,1174 typename vector_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::result_type 1175 >::type1172 typename vector_binary_scalar1_traits< const typename boost::enable_if_c<boost::is_arithmetic<T1>::value, T1>::type, 1173 E2, 1174 scalar_multiplies<T1, typename E2::value_type> >::result_type 1176 1175 operator * (const T1 &e1, 1177 1176 const vector_expression<E2> &e2) { 1178 1177 typedef typename vector_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::expression_type expression_type; … … 1397 1396 // (v * t) [i] = v [i] * t 1398 1397 template<class E1, class T2> 1399 1398 BOOST_UBLAS_INLINE 1400 typename enable_if< is_convertible<T2, typename E1::value_type >, 1401 typename vector_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::result_type 1402 >::type 1399 typename vector_binary_scalar2_traits<E1, const typename boost::enable_if_c<boost::is_arithmetic<T2>::value, T2>::type, scalar_multiplies<typename E1::value_type, T2> >::result_type 1403 1400 operator * (const vector_expression<E1> &e1, 1404 1401 const T2 &e2) { 1405 1402 typedef typename vector_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::expression_type expression_type;