From a46720bfc09fc773fc900fe97f7b6c5762e7cb22 Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Sat, 5 Sep 2009 12:51:10 +0000 Subject: [PATCH] see #3397 vector_expression.hpp: added enable_if to expression scalar * vector and vector * scalar matrix_expression.hpp: added enable_if to expression scalar * matrix and matrix * scalar svn path=/trunk/boost/numeric/ublas/; revision=56045 --- include/boost/numeric/ublas/matrix_expression.hpp | 4 ++++ include/boost/numeric/ublas/vector_expression.hpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/boost/numeric/ublas/matrix_expression.hpp b/include/boost/numeric/ublas/matrix_expression.hpp index 37ef2204..f59045f4 100644 --- a/include/boost/numeric/ublas/matrix_expression.hpp +++ b/include/boost/numeric/ublas/matrix_expression.hpp @@ -2940,7 +2940,9 @@ namespace boost { namespace numeric { namespace ublas { // (t * m) [i] [j] = t * m [i] [j] template BOOST_UBLAS_INLINE + typename enable_if< is_convertible, typename matrix_binary_scalar1_traits >::result_type + >::type operator * (const T1 &e1, const matrix_expression &e2) { typedef typename matrix_binary_scalar1_traits >::expression_type expression_type; @@ -3373,7 +3375,9 @@ namespace boost { namespace numeric { namespace ublas { // (m * t) [i] [j] = m [i] [j] * t template BOOST_UBLAS_INLINE + typename enable_if< is_convertible, typename matrix_binary_scalar2_traits >::result_type + >::type operator * (const matrix_expression &e1, const T2 &e2) { typedef typename matrix_binary_scalar2_traits >::expression_type expression_type; diff --git a/include/boost/numeric/ublas/vector_expression.hpp b/include/boost/numeric/ublas/vector_expression.hpp index e383ab38..a5cf3104 100644 --- a/include/boost/numeric/ublas/vector_expression.hpp +++ b/include/boost/numeric/ublas/vector_expression.hpp @@ -1170,7 +1170,9 @@ namespace boost { namespace numeric { namespace ublas { // (t * v) [i] = t * v [i] template BOOST_UBLAS_INLINE + typename enable_if< is_convertible, typename vector_binary_scalar1_traits >::result_type + >::type operator * (const T1 &e1, const vector_expression &e2) { typedef typename vector_binary_scalar1_traits >::expression_type expression_type; @@ -1395,7 +1397,9 @@ namespace boost { namespace numeric { namespace ublas { // (v * t) [i] = v [i] * t template BOOST_UBLAS_INLINE + typename enable_if< is_convertible, typename vector_binary_scalar2_traits >::result_type + >::type operator * (const vector_expression &e1, const T2 &e2) { typedef typename vector_binary_scalar2_traits >::expression_type expression_type;