diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2010-11-26 16:30:45 +0100 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2010-11-26 16:30:45 +0100 |
commit | bf9d25ce5802cbf64c36ac646521a4b24e6a5118 (patch) | |
tree | ac9bc6e2f35708bf0a83714b86f7f7707d32107f /Eigen/src/Core/util/Meta.h | |
parent | 139392488d16226eee03894b5dabf32f5f96de33 (diff) |
Postfixed add_const and remove_const by _on_value_type to express the differences to the STL.
Diffstat (limited to 'Eigen/src/Core/util/Meta.h')
-rw-r--r-- | Eigen/src/Core/util/Meta.h | 22 |
1 files changed, 11 insertions, 11 deletions
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 |