Ticket #2186: adl_problem.patch
File adl_problem.patch, 1.5 KB (added by , 14 years ago) |
---|
-
traits.hpp
24 24 #include <boost/type_traits.hpp> 25 25 #include <complex> 26 26 27 // anonymous namespace to avoid ADL issues 28 namespace { 29 template<class T> T boost_numeric_ublas_sqrt (const T& t) { 30 using namespace std; 31 // we'll find either std::sqrt or else another version via ADL: 32 return sqrt (t); 33 } 34 template<class T> T boost_numeric_ublas_abs (const T& t) { 35 using namespace std; 36 // we'll find either std::abs or else another version via ADL: 37 return abs (t); 38 } 39 } 40 27 41 namespace boost { namespace numeric { namespace ublas { 28 42 29 43 // Use Joel de Guzman's return type deduction … … 84 98 static 85 99 BOOST_UBLAS_INLINE 86 100 real_type type_abs (const_reference t) { 87 // we'll find either std::abs or else another version via ADL: 88 using namespace std; 89 return abs (t); 101 return boost_numeric_ublas_abs (t); 90 102 } 91 103 static 92 104 BOOST_UBLAS_INLINE 93 105 value_type type_sqrt (const_reference t) { 94 using namespace std;95 106 // force a type conversion back to value_type for intgral types 96 // we'll find either std::sqrt or else another version via ADL: 97 return value_type (sqrt (t)); 107 return value_type (boost_numeric_ublas_sqrt (t)); 98 108 } 99 109 100 110 static