summaryrefslogtreecommitdiffhomepage
path: root/eigen/Eigen/src/Core/util/Meta.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-07-03 07:37:12 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-07-03 08:13:09 +0200
commit88534ba623421c956d8ffcda2d27f41d704d15ef (patch)
treefccc55245aec3f7381cd525a1355568e10ea37f4 /eigen/Eigen/src/Core/util/Meta.h
parent3ee09beb3f0458fbeb0b0e816f854b9d5b406e6b (diff)
update eigen
Diffstat (limited to 'eigen/Eigen/src/Core/util/Meta.h')
-rw-r--r--eigen/Eigen/src/Core/util/Meta.h86
1 files changed, 14 insertions, 72 deletions
diff --git a/eigen/Eigen/src/Core/util/Meta.h b/eigen/Eigen/src/Core/util/Meta.h
index 8de6055..7f63707 100644
--- a/eigen/Eigen/src/Core/util/Meta.h
+++ b/eigen/Eigen/src/Core/util/Meta.h
@@ -97,22 +97,17 @@ template<> struct is_arithmetic<unsigned int> { enum { value = true }; };
template<> struct is_arithmetic<signed long> { enum { value = true }; };
template<> struct is_arithmetic<unsigned long> { enum { value = true }; };
-#if EIGEN_HAS_CXX11
-using std::is_integral;
-#else
-template<typename T> struct is_integral { enum { value = false }; };
-template<> struct is_integral<bool> { enum { value = true }; };
-template<> struct is_integral<char> { enum { value = true }; };
-template<> struct is_integral<signed char> { enum { value = true }; };
-template<> struct is_integral<unsigned char> { enum { value = true }; };
-template<> struct is_integral<signed short> { enum { value = true }; };
-template<> struct is_integral<unsigned short> { enum { value = true }; };
-template<> struct is_integral<signed int> { enum { value = true }; };
-template<> struct is_integral<unsigned int> { enum { value = true }; };
-template<> struct is_integral<signed long> { enum { value = true }; };
-template<> struct is_integral<unsigned long> { enum { value = true }; };
-#endif
-
+template<typename T> struct is_integral { enum { value = false }; };
+template<> struct is_integral<bool> { enum { value = true }; };
+template<> struct is_integral<char> { enum { value = true }; };
+template<> struct is_integral<signed char> { enum { value = true }; };
+template<> struct is_integral<unsigned char> { enum { value = true }; };
+template<> struct is_integral<signed short> { enum { value = true }; };
+template<> struct is_integral<unsigned short> { enum { value = true }; };
+template<> struct is_integral<signed int> { enum { value = true }; };
+template<> struct is_integral<unsigned int> { enum { value = true }; };
+template<> struct is_integral<signed long> { enum { value = true }; };
+template<> struct is_integral<unsigned long> { enum { value = true }; };
template <typename T> struct add_const { typedef const T type; };
template <typename T> struct add_const<T&> { typedef T& type; };
@@ -284,59 +279,6 @@ protected:
};
/** \internal
- * Provides access to the number of elements in the object of as a compile-time constant expression.
- * It "returns" Eigen::Dynamic if the size cannot be resolved at compile-time (default).
- *
- * Similar to std::tuple_size, but more general.
- *
- * It currently supports:
- * - any types T defining T::SizeAtCompileTime
- * - plain C arrays as T[N]
- * - std::array (c++11)
- * - some internal types such as SingleRange and AllRange
- *
- * The second template parameter eases SFINAE-based specializations.
- */
-template<typename T, typename EnableIf = void> struct array_size {
- enum { value = Dynamic };
-};
-
-template<typename T> struct array_size<T,typename internal::enable_if<((T::SizeAtCompileTime&0)==0)>::type> {
- enum { value = T::SizeAtCompileTime };
-};
-
-template<typename T, int N> struct array_size<const T (&)[N]> {
- enum { value = N };
-};
-template<typename T, int N> struct array_size<T (&)[N]> {
- enum { value = N };
-};
-
-#if EIGEN_HAS_CXX11
-template<typename T, std::size_t N> struct array_size<const std::array<T,N> > {
- enum { value = N };
-};
-template<typename T, std::size_t N> struct array_size<std::array<T,N> > {
- enum { value = N };
-};
-#endif
-
-/** \internal
- * Analogue of the std::size free function.
- * It returns the size of the container or view \a x of type \c T
- *
- * It currently supports:
- * - any types T defining a member T::size() const
- * - plain C arrays as T[N]
- *
- */
-template<typename T>
-Index size(const T& x) { return x.size(); }
-
-template<typename T,std::size_t N>
-Index size(const T (&) [N]) { return N; }
-
-/** \internal
* Convenient struct to get the result type of a unary or binary functor.
*
* It supports both the current STL mechanism (using the result_type member) as well as
@@ -433,10 +375,10 @@ struct meta_no { char a[2]; };
template <typename T>
struct has_ReturnType
{
- template <typename C> static meta_yes testFunctor(C const *, typename C::ReturnType const * = 0);
- template <typename C> static meta_no testFunctor(...);
+ template <typename C> static meta_yes testFunctor(typename C::ReturnType const *);
+ template <typename C> static meta_no testFunctor(...);
- enum { value = sizeof(testFunctor<T>(static_cast<T*>(0))) == sizeof(meta_yes) };
+ enum { value = sizeof(testFunctor<T>(0)) == sizeof(meta_yes) };
};
template<typename T> const T* return_ptr();