diff options
-rw-r--r-- | Eigen/src/Core/ForceAlignedAccess.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Functors.h | 6 | ||||
-rw-r--r-- | Eigen/src/Core/MathFunctions.h | 4 | ||||
-rw-r--r-- | Eigen/src/Core/MatrixBase.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/util/Meta.h | 22 | ||||
-rw-r--r-- | test/meta.cpp | 8 |
6 files changed, 22 insertions, 22 deletions
diff --git a/Eigen/src/Core/ForceAlignedAccess.h b/Eigen/src/Core/ForceAlignedAccess.h index 2a6f1cf4e..11c1f8f70 100644 --- a/Eigen/src/Core/ForceAlignedAccess.h +++ b/Eigen/src/Core/ForceAlignedAccess.h @@ -137,7 +137,7 @@ MatrixBase<Derived>::forceAlignedAccess() */ template<typename Derived> template<bool Enable> -inline typename internal::add_const<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type +inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type MatrixBase<Derived>::forceAlignedAccessIf() const { return derived(); diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h index f2aaea145..69f17fb73 100644 --- a/Eigen/src/Core/Functors.h +++ b/Eigen/src/Core/Functors.h @@ -419,7 +419,7 @@ struct scalar_multiple_op { EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a * m_other; } EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pmul(a, pset1<Packet>(m_other)); } - typename add_const<typename NumTraits<Scalar>::Nested>::type m_other; + typename add_const_on_value_type<typename NumTraits<Scalar>::Nested>::type m_other; }; template<typename Scalar> struct functor_traits<scalar_multiple_op<Scalar> > @@ -431,7 +431,7 @@ struct scalar_multiple2_op { EIGEN_STRONG_INLINE scalar_multiple2_op(const scalar_multiple2_op& other) : m_other(other.m_other) { } EIGEN_STRONG_INLINE scalar_multiple2_op(const Scalar2& other) : m_other(other) { } EIGEN_STRONG_INLINE result_type operator() (const Scalar1& a) const { return a * m_other; } - typename add_const<typename NumTraits<Scalar2>::Nested>::type m_other; + typename add_const_on_value_type<typename NumTraits<Scalar2>::Nested>::type m_other; }; template<typename Scalar1,typename Scalar2> struct functor_traits<scalar_multiple2_op<Scalar1,Scalar2> > @@ -458,7 +458,7 @@ struct scalar_quotient1_impl<Scalar,true> { EIGEN_STRONG_INLINE scalar_quotient1_impl(const scalar_quotient1_impl& other) : m_other(other.m_other) { } EIGEN_STRONG_INLINE scalar_quotient1_impl(const Scalar& other) : m_other(other) {} EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; } - typename add_const<typename NumTraits<Scalar>::Nested>::type m_other; + typename add_const_on_value_type<typename NumTraits<Scalar>::Nested>::type m_other; }; template<typename Scalar> struct functor_traits<scalar_quotient1_impl<Scalar,true> > diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 6651b6535..1f7643d64 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -163,7 +163,7 @@ struct real_ref_retval }; template<typename Scalar> -inline typename add_const< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x) +inline typename add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x) { return real_ref_impl<Scalar>::run(x); } @@ -215,7 +215,7 @@ struct imag_ref_retval }; template<typename Scalar> -inline typename add_const< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x) +inline typename add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x) { return imag_ref_impl<Scalar>::run(x); } diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index a1b84bd94..0dca72dbd 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -277,7 +277,7 @@ template<typename Derived> class MatrixBase inline const ForceAlignedAccess<Derived> forceAlignedAccess() const; inline ForceAlignedAccess<Derived> forceAlignedAccess(); - template<bool Enable> inline typename internal::add_const<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type forceAlignedAccessIf() const; + template<bool Enable> inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type forceAlignedAccessIf() const; template<bool Enable> inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf(); Scalar trace() const; diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index bb9a66cf1..2c8ee26a1 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -54,10 +54,10 @@ template<typename T> struct remove_pointer { typedef T type; }; template<typename T> struct remove_pointer<T*> { typedef T type; }; template<typename T> struct remove_pointer<T*const> { typedef T type; }; -template<typename T> struct remove_const { typedef T type; }; -template<typename T> struct remove_const<const T> { typedef T type; }; -template<typename T> struct remove_const<T const &> { typedef T & type; }; -template<typename T> struct remove_const<T const *> { typedef T * type; }; +template<typename T> struct remove_const_on_value_type { typedef T type; }; +template<typename T> struct remove_const_on_value_type<const T> { typedef T type; }; +template<typename T> struct remove_const_on_value_type<T const &> { typedef T & type; }; +template<typename T> struct remove_const_on_value_type<T const *> { typedef T * type; }; template<typename T> struct remove_all { typedef T type; }; template<typename T> struct remove_all<const T> { typedef typename remove_all<T>::type type; }; @@ -83,16 +83,16 @@ template<> struct is_arithmetic<unsigned long> { enum { value = true }; }; template<> struct is_arithmetic<signed long long> { enum { value = true }; }; template<> struct is_arithmetic<unsigned long long> { enum { value = true }; }; -template<typename T> struct add_const { typedef const T type; }; -template<typename T> struct add_const<const T> { typedef const T type; }; -template<typename T> struct add_const<T&> { typedef const T& type; }; -template<typename T> struct add_const<const T&> { typedef const T& type; }; -template<typename T> struct add_const<T*> { typedef const T* type; }; -template<typename T> struct add_const<const T*> { typedef const T* type; }; +template<typename T> struct add_const_on_value_type { typedef const T type; }; +template<typename T> struct add_const_on_value_type<const T> { typedef const T type; }; +template<typename T> struct add_const_on_value_type<T&> { typedef const T& type; }; +template<typename T> struct add_const_on_value_type<const T&> { typedef const T& type; }; +template<typename T> struct add_const_on_value_type<T*> { typedef const T* type; }; +template<typename T> struct add_const_on_value_type<const T*> { typedef const T* type; }; template<typename T> struct makeconst_return_type { - typedef typename conditional<is_arithmetic<T>::value, T, typename add_const<T>::type>::type type; + typedef typename conditional<is_arithmetic<T>::value, T, typename add_const_on_value_type<T>::type>::type type; }; /** \internal Allows to enable/disable an overload diff --git a/test/meta.cpp b/test/meta.cpp index 9adb95034..2c3c2985a 100644 --- a/test/meta.cpp +++ b/test/meta.cpp @@ -43,11 +43,11 @@ void test_meta() VERIFY(( internal::is_same<float,internal::remove_all<float* const *&>::type >::value)); VERIFY(( internal::is_same<float,internal::remove_all<float* const>::type >::value)); - VERIFY(( internal::is_same<float*,internal::remove_const<const float*>::type >::value)); - VERIFY(( internal::is_same<float&,internal::remove_const<const float&>::type >::value)); - VERIFY(( internal::is_same<float&,internal::remove_const<ConstFloatRef>::type >::value)); + VERIFY(( internal::is_same<float*,internal::remove_const_on_value_type<const float*>::type >::value)); + VERIFY(( internal::is_same<float&,internal::remove_const_on_value_type<const float&>::type >::value)); + VERIFY(( internal::is_same<float&,internal::remove_const_on_value_type<ConstFloatRef>::type >::value)); - VERIFY(( internal::is_same<float&,internal::remove_const<float&>::type >::value)); + VERIFY(( internal::is_same<float&,internal::remove_const_on_value_type<float&>::type >::value)); VERIFY(( internal::is_same<float,internal::remove_reference<float&>::type >::value)); VERIFY(( internal::is_same<const float,internal::remove_reference<const float&>::type >::value)); VERIFY(( internal::is_same<float,internal::remove_pointer<float*>::type >::value)); |