Ticket #4441: enable_if_sfinae.patch

File enable_if_sfinae.patch, 3.5 KB (added by Jesse Perla <jesseperla@…>, 12 years ago)
  • matrix_expression.hpp

     
    29402940    // (t * m) [i] [j] = t * m [i] [j]
    29412941    template<class T1, class E2>
    29422942    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
    29462944    operator * (const T1 &e1,
    29472945                const matrix_expression<E2> &e2) {
    29482946        typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::expression_type expression_type;
     
    33753373    // (m * t) [i] [j] = m [i] [j] * t
    33763374    template<class E1, class T2>
    33773375    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
    33813377    operator * (const matrix_expression<E1> &e1,
    33823378                const T2 &e2) {
    33833379        typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::expression_type expression_type;
  • vector_expression.hpp

     
    1515
    1616#include <boost/numeric/ublas/expression_types.hpp>
    1717
    18 
    1918// Expression templates based on ideas of Todd Veldhuizen and Geoffrey Furnish
    2019// Iterators based on ideas of Jeremy Siek
    2120//
     
    11701169    // (t * v) [i] = t * v [i]
    11711170    template<class T1, class E2>
    11721171    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     >::type
     1172    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
    11761175    operator * (const T1 &e1,
    11771176                const vector_expression<E2> &e2) {
    11781177        typedef typename vector_binary_scalar1_traits<const T1, E2, scalar_multiplies<T1, typename E2::value_type> >::expression_type expression_type;
     
    13971396    // (v * t) [i] = v [i] * t
    13981397    template<class E1, class T2>
    13991398    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
    14031400    operator * (const vector_expression<E1> &e1,
    14041401                const T2 &e2) {
    14051402        typedef typename vector_binary_scalar2_traits<E1, const T2, scalar_multiplies<typename E1::value_type, T2> >::expression_type expression_type;