From 60a544c8795bc2c355099f74a9b0fda795b13c6a Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Fri, 26 Nov 2010 16:56:03 +0100 Subject: [PATCH] Added STL like (add|remove)_const. Fixed add_const_on_value_type for "const T* const". --- Eigen/src/Core/util/Meta.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 2c8ee26a1..28d7189b5 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -54,6 +54,11 @@ template struct remove_pointer { typedef T type; }; template struct remove_pointer { typedef T type; }; template struct remove_pointer { typedef T type; }; +template struct remove_const { typedef T type; }; +template struct remove_const { typedef T type; }; +template struct remove_const { typedef T type[]; }; +template struct remove_const { typedef T type[Size]; }; + template struct remove_const_on_value_type { typedef T type; }; template struct remove_const_on_value_type { typedef T type; }; template struct remove_const_on_value_type { typedef T & type; }; @@ -83,12 +88,13 @@ template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; +template struct add_const { typedef const T type; }; +template struct add_const { typedef T& type; }; + template struct add_const_on_value_type { typedef const T type; }; -template struct add_const_on_value_type { typedef const T type; }; -template struct add_const_on_value_type { typedef const T& type; }; -template struct add_const_on_value_type { typedef const T& type; }; -template struct add_const_on_value_type { typedef const T* type; }; -template struct add_const_on_value_type { typedef const T* type; }; +template struct add_const_on_value_type { typedef T const& type; }; +template struct add_const_on_value_type { typedef T const* type; }; +template struct add_const_on_value_type { typedef const T* const type; }; template struct makeconst_return_type {