diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index de0c7f0ea..b65285282 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -147,7 +147,6 @@ class Array } #endif -#if EIGEN_HAS_RVALUE_REFERENCES EIGEN_DEVICE_FUNC Array(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) : Base(std::move(other)) @@ -159,7 +158,6 @@ class Array Base::operator=(std::move(other)); return *this; } -#endif /** \copydoc PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) * diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 2f6c9889f..04afd72ba 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -225,10 +225,8 @@ template class DenseSt EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage&) = default; #endif EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage&) = default; -#if EIGEN_HAS_RVALUE_REFERENCES EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&&) = default; EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&&) = default; -#endif EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) eigen_internal_assert(size==rows*cols && rows==Rows_ && cols==Cols_); @@ -422,7 +420,6 @@ template class DenseStorage class DenseStorage(m_data, m_rows*m_cols); } EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { @@ -505,7 +501,6 @@ template class DenseStorage class DenseStorage(m_data, Rows_*m_cols); } EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { numext::swap(m_data,other.m_data); @@ -581,7 +575,6 @@ template class DenseStorage class DenseStorage(m_data, Cols_*m_rows); } EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { numext::swap(m_data,other.m_data); diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 2893ddf21..44c0e258f 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -269,7 +269,6 @@ class Matrix : Base(internal::constructor_without_unaligned_array_assert()) { EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED } -#if EIGEN_HAS_RVALUE_REFERENCES EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) : Base(std::move(other)) {} @@ -279,7 +278,6 @@ class Matrix Base::operator=(std::move(other)); return *this; } -#endif /** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&... args) * diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index c9b14ad7b..89960b9b5 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -501,7 +501,6 @@ class PlainObjectBase : public internal::dense_xpr_base::type } #endif -#if EIGEN_HAS_RVALUE_REFERENCES EIGEN_DEVICE_FUNC PlainObjectBase(PlainObjectBase&& other) EIGEN_NOEXCEPT : m_storage( std::move(other.m_storage) ) @@ -514,7 +513,6 @@ class PlainObjectBase : public internal::dense_xpr_base::type m_storage = std::move(other.m_storage); return *this; } -#endif /** Copy constructor */ EIGEN_DEVICE_FUNC diff --git a/Eigen/src/Core/functors/StlFunctors.h b/Eigen/src/Core/functors/StlFunctors.h index dbb385439..5971075dd 100644 --- a/Eigen/src/Core/functors/StlFunctors.h +++ b/Eigen/src/Core/functors/StlFunctors.h @@ -104,17 +104,6 @@ template struct functor_traits > : functor_traits > {}; -#if (EIGEN_COMP_CXXVER < 11) -// std::binder* are deprecated since c++11 and will be removed in c++17 -template -struct functor_traits > -{ enum { Cost = functor_traits::Cost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = functor_traits::Cost, PacketAccess = false }; }; -#endif - #if (EIGEN_COMP_CXXVER < 17) // std::unary_negate is deprecated since c++17 and will be removed in c++20 template diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h index 72e094e56..007c71e34 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrix.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h @@ -150,9 +150,6 @@ static void run(Index rows, Index cols, Index depth, // Release all the sub blocks A'_i of A' for the current thread, // i.e., we simply decrement the number of users by 1 for(Index i=0; i -#endif #include "../InternalHeaderCheck.h" @@ -86,13 +84,8 @@ template struct GemmParallelInfo // to guarantee that when thread A says to thread B that it is // done with packing a block, then all writes have been really // carried out... C++11 memory model+atomic guarantees this. -#if EIGEN_HAS_CXX11_ATOMIC std::atomic sync; std::atomic users; -#else - Index volatile sync; - int volatile users; -#endif Index lhs_start; Index lhs_length; @@ -106,7 +99,7 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, // Without C++11, we have to disable GEMM's parallelization on // non x86 architectures because there volatile is not enough for our purpose. // See bug 1572. -#if (! defined(EIGEN_HAS_OPENMP)) || defined(EIGEN_USE_BLAS) || ((!EIGEN_HAS_CXX11_ATOMIC) && !(EIGEN_ARCH_i386_OR_x86_64)) +#if (! defined(EIGEN_HAS_OPENMP)) || defined(EIGEN_USE_BLAS) // FIXME the transpose variable is only needed to properly split // the matrix product when multithreading is enabled. This is a temporary // fix to support row-major destination matrices. This whole diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 0ff766903..e76ddd3d2 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -637,8 +637,7 @@ // individual features as defined later. // This is why there is no EIGEN_HAS_CXX17. // FIXME: get rid of EIGEN_HAS_CXX14. -#if EIGEN_MAX_CPP_VER>=11 && EIGEN_COMP_CXXVER>=11 -#else +#if EIGEN_MAX_CPP_VER<11 || EIGEN_COMP_CXXVER<11 || (EIGEN_COMP_MSVC && EIGEN_COMP_MSVC < 1700) || (EIGEN_COMP_ICC && EIGEN_COMP_ICC < 1400) #error This compiler appears to be too old to be supported by Eigen #endif @@ -648,23 +647,11 @@ #define EIGEN_HAS_CXX14 0 #endif -// Do we support r-value references? -#ifndef EIGEN_HAS_RVALUE_REFERENCES -#if EIGEN_MAX_CPP_VER>=11 && \ - (__has_feature(cxx_rvalue_references) || \ - (EIGEN_COMP_CXXVER >= 11) || (EIGEN_COMP_MSVC >= 1600)) - #define EIGEN_HAS_RVALUE_REFERENCES 1 -#else - #define EIGEN_HAS_RVALUE_REFERENCES 0 -#endif -#endif - // Does the compiler support C99? // Need to include to make sure _GLIBCXX_USE_C99 gets defined #include #ifndef EIGEN_HAS_C99_MATH -#if EIGEN_MAX_CPP_VER>=11 && \ - ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \ +#if ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \ || (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \ || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER)) \ || (EIGEN_COMP_MSVC >= 1900) || defined(SYCL_DEVICE_ONLY)) @@ -704,8 +691,7 @@ #endif #ifndef EIGEN_HAS_ALIGNAS -#if EIGEN_MAX_CPP_VER>=11 && \ - ( __has_feature(cxx_alignas) \ +#if ( __has_feature(cxx_alignas) \ || EIGEN_HAS_CXX14 \ || (EIGEN_COMP_MSVC >= 1800) \ || (EIGEN_GNUC_AT_LEAST(4,8)) \ @@ -723,8 +709,7 @@ // - full support of type traits was added only to GCC 5.1.0. // - 20150626 corresponds to the last release of 4.x libstdc++ #ifndef EIGEN_HAS_TYPE_TRAITS -#if EIGEN_MAX_CPP_VER>=11 \ - && ((!EIGEN_COMP_GNUC_STRICT) || EIGEN_GNUC_AT_LEAST(5, 1)) \ +#if ((!EIGEN_COMP_GNUC_STRICT) || EIGEN_GNUC_AT_LEAST(5, 1)) \ && ((!defined(__GLIBCXX__)) || __GLIBCXX__ > 20150626) #define EIGEN_HAS_TYPE_TRAITS 1 #define EIGEN_INCLUDE_TYPE_TRAITS @@ -735,12 +720,11 @@ // Does the compiler support variadic templates? #ifndef EIGEN_HAS_VARIADIC_TEMPLATES -#if EIGEN_MAX_CPP_VER>=11 && (EIGEN_COMP_CXXVER >= 11) \ - && (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_COMP_NVCC >= 80000) ) +#if (!defined(__NVCC__) || !EIGEN_ARCH_ARM_OR_ARM64 || (EIGEN_COMP_NVCC >= 80000) ) // ^^ Disable the use of variadic templates when compiling with versions of nvcc older than 8.0 on ARM devices: // this prevents nvcc from crashing when compiling Eigen on Tegra X1 #define EIGEN_HAS_VARIADIC_TEMPLATES 1 -#elif EIGEN_MAX_CPP_VER>=11 && (EIGEN_COMP_CXXVER >= 11) && defined(SYCL_DEVICE_ONLY) +#elif defined(SYCL_DEVICE_ONLY) #define EIGEN_HAS_VARIADIC_TEMPLATES 1 #else #define EIGEN_HAS_VARIADIC_TEMPLATES 0 @@ -751,7 +735,7 @@ #ifndef EIGEN_HAS_CONSTEXPR #if defined(EIGEN_CUDACC) // Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above - #if EIGEN_MAX_CPP_VER>=14 && (EIGEN_COMP_CXXVER >= 11 && (EIGEN_COMP_CLANG || EIGEN_COMP_NVCC >= 70500)) + #if EIGEN_MAX_CPP_VER>=14 && (EIGEN_COMP_CLANG || EIGEN_COMP_NVCC >= 70500) #define EIGEN_HAS_CONSTEXPR 1 #endif #elif EIGEN_MAX_CPP_VER>=14 && (__has_feature(cxx_relaxed_constexpr) || (EIGEN_COMP_CXXVER >= 14) || \ @@ -775,7 +759,7 @@ // Does the compiler support C++11 math? // Let's be conservative and enable the default C++11 implementation only if we are sure it exists #ifndef EIGEN_HAS_CXX11_MATH - #if EIGEN_MAX_CPP_VER>=11 && ((EIGEN_COMP_CXXVER > 11) || (EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \ + #if ((EIGEN_COMP_CXXVER > 11) || (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC) \ && (EIGEN_ARCH_i386_OR_x86_64) && (EIGEN_OS_GNULINUX || EIGEN_OS_WIN_STRICT || EIGEN_OS_MAC)) #define EIGEN_HAS_CXX11_MATH 1 #else @@ -783,49 +767,6 @@ #endif #endif -// Does the compiler support proper C++11 containers? -#ifndef EIGEN_HAS_CXX11_CONTAINERS - #if EIGEN_MAX_CPP_VER>=11 && \ - ((EIGEN_COMP_CXXVER > 11) \ - || ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC>=1400))) - #define EIGEN_HAS_CXX11_CONTAINERS 1 - #else - #define EIGEN_HAS_CXX11_CONTAINERS 0 - #endif -#endif - -// Does the compiler support C++11 noexcept? -#ifndef EIGEN_HAS_CXX11_NOEXCEPT - #if EIGEN_MAX_CPP_VER>=11 && \ - (__has_feature(cxx_noexcept) \ - || (EIGEN_COMP_CXXVER > 11) \ - || ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_GNUC_STRICT || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC || EIGEN_COMP_ICC>=1400))) - #define EIGEN_HAS_CXX11_NOEXCEPT 1 - #else - #define EIGEN_HAS_CXX11_NOEXCEPT 0 - #endif -#endif - -#ifndef EIGEN_HAS_CXX11_ATOMIC - #if EIGEN_MAX_CPP_VER>=11 && \ - (__has_feature(cxx_atomic) \ - || (EIGEN_COMP_CXXVER > 11) \ - || ((EIGEN_COMP_CXXVER == 11) && (EIGEN_COMP_MSVC==0 || EIGEN_COMP_MSVC >= 1700))) - #define EIGEN_HAS_CXX11_ATOMIC 1 - #else - #define EIGEN_HAS_CXX11_ATOMIC 0 - #endif -#endif - -#ifndef EIGEN_HAS_CXX11_OVERRIDE_FINAL - #if EIGEN_MAX_CPP_VER>=11 && \ - (EIGEN_COMP_CXXVER >= 11 || EIGEN_COMP_MSVC >= 1700) - #define EIGEN_HAS_CXX11_OVERRIDE_FINAL 1 - #else - #define EIGEN_HAS_CXX11_OVERRIDE_FINAL 0 - #endif -#endif - // NOTE: the required Apple's clang version is very conservative // and it could be that XCode 9 works just fine. // NOTE: the MSVC version is based on https://en.cppreference.com/w/cpp/compiler_support @@ -1366,24 +1307,12 @@ namespace Eigen { #endif -#if EIGEN_HAS_CXX11_NOEXCEPT -# define EIGEN_INCLUDE_TYPE_TRAITS -# define EIGEN_NOEXCEPT noexcept -# define EIGEN_NOEXCEPT_IF(x) noexcept(x) -# define EIGEN_NO_THROW noexcept(true) -# define EIGEN_EXCEPTION_SPEC(X) noexcept(false) -#else -# define EIGEN_NOEXCEPT -# define EIGEN_NOEXCEPT_IF(x) -# define EIGEN_NO_THROW throw() -# if EIGEN_COMP_MSVC || EIGEN_COMP_CXXVER>=17 - // MSVC does not support exception specifications (warning C4290), - // and they are deprecated in c++11 anyway. This is even an error in c++17. -# define EIGEN_EXCEPTION_SPEC(X) throw() -# else -# define EIGEN_EXCEPTION_SPEC(X) throw(X) -# endif -#endif +#define EIGEN_INCLUDE_TYPE_TRAITS +#define EIGEN_NOEXCEPT noexcept +#define EIGEN_NOEXCEPT_IF(x) noexcept(x) +#define EIGEN_NO_THROW noexcept(true) +#define EIGEN_EXCEPTION_SPEC(X) noexcept(false) + #if EIGEN_HAS_VARIADIC_TEMPLATES // The all function is used to enable a variadic version of eigen_assert which can take a parameter pack as its input. @@ -1399,14 +1328,9 @@ bool all(T t, Ts ... ts){ return t && all(ts...); } } #endif -#if EIGEN_HAS_CXX11_OVERRIDE_FINAL // provide override and final specifiers if they are available: -# define EIGEN_OVERRIDE override -# define EIGEN_FINAL final -#else -# define EIGEN_OVERRIDE -# define EIGEN_FINAL -#endif +#define EIGEN_OVERRIDE override +#define EIGEN_FINAL final // Wrapping #pragma unroll in a macro since it is required for SYCL #if defined(SYCL_DEVICE_ONLY) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 909d00ede..5211d04a3 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -568,17 +568,10 @@ template struct smart_memmove_helper { } }; -#if EIGEN_HAS_RVALUE_REFERENCES template EIGEN_DEVICE_FUNC T* smart_move(T* start, T* end, T* target) { return std::move(start, end, target); } -#else -template EIGEN_DEVICE_FUNC T* smart_move(T* start, T* end, T* target) -{ - return std::copy(start, end, target); -} -#endif /***************************************************************************** *** Implementation of runtime stack allocation (falling back to malloc) *** diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 08267d7be..f2c4dfede 100755 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -28,7 +28,7 @@ #endif // Recent versions of ICC require for pointer types below. -#define EIGEN_ICC_NEEDS_CSTDINT (EIGEN_COMP_ICC>=1600 && EIGEN_COMP_CXXVER >= 11) +#define EIGEN_ICC_NEEDS_CSTDINT (EIGEN_COMP_ICC>=1600) // Define portable (u)int{32,64} types #include diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index 42ce0bbfb..e291bf30f 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -319,7 +319,6 @@ public: EIGEN_DEVICE_FUNC explicit inline Quaternion(const Quaternion& other) { m_coeffs = other.coeffs().template cast(); } -#if EIGEN_HAS_RVALUE_REFERENCES // We define a copy constructor, which means we don't get an implicit move constructor or assignment operator. /** Default move constructor */ EIGEN_DEVICE_FUNC inline Quaternion(Quaternion&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) @@ -332,7 +331,6 @@ public: m_coeffs = std::move(other.coeffs()); return *this; } -#endif EIGEN_DEVICE_FUNC static Quaternion UnitRandom(); diff --git a/Eigen/src/StlSupport/StdDeque.h b/Eigen/src/StlSupport/StdDeque.h index cd79a1512..1e951821d 100644 --- a/Eigen/src/StlSupport/StdDeque.h +++ b/Eigen/src/StlSupport/StdDeque.h @@ -48,73 +48,4 @@ namespace std \ }; \ } -// check whether we really need the std::deque specialization -#if !EIGEN_HAS_CXX11_CONTAINERS && !(defined(_GLIBCXX_DEQUE) && (!EIGEN_GNUC_AT_LEAST(4,1))) /* Note that before gcc-4.1 we already have: std::deque::resize(size_type,const T&). */ - -namespace std { - -#define EIGEN_STD_DEQUE_SPECIALIZATION_BODY \ - public: \ - typedef T value_type; \ - typedef typename deque_base::allocator_type allocator_type; \ - typedef typename deque_base::size_type size_type; \ - typedef typename deque_base::iterator iterator; \ - typedef typename deque_base::const_iterator const_iterator; \ - explicit deque(const allocator_type& a = allocator_type()) : deque_base(a) {} \ - template \ - deque(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \ - : deque_base(first, last, a) {} \ - deque(const deque& c) : deque_base(c) {} \ - explicit deque(size_type num, const value_type& val = value_type()) : deque_base(num, val) {} \ - deque(iterator start_, iterator end_) : deque_base(start_, end_) {} \ - deque& operator=(const deque& x) { \ - deque_base::operator=(x); \ - return *this; \ - } - - template - class deque > - : public deque > -{ - typedef deque > deque_base; - EIGEN_STD_DEQUE_SPECIALIZATION_BODY - - void resize(size_type new_size) - { resize(new_size, T()); } - -#if defined(_DEQUE_) - // workaround MSVC std::deque implementation - void resize(size_type new_size, const value_type& x) - { - if (deque_base::size() < new_size) - deque_base::_Insert_n(deque_base::end(), new_size - deque_base::size(), x); - else if (new_size < deque_base::size()) - deque_base::erase(deque_base::begin() + new_size, deque_base::end()); - } - void push_back(const value_type& x) - { deque_base::push_back(x); } - void push_front(const value_type& x) - { deque_base::push_front(x); } - using deque_base::insert; - iterator insert(const_iterator position, const value_type& x) - { return deque_base::insert(position,x); } - void insert(const_iterator position, size_type new_size, const value_type& x) - { deque_base::insert(position, new_size, x); } -#else - // default implementation which should always work. - void resize(size_type new_size, const value_type& x) - { - if (new_size < deque_base::size()) - deque_base::erase(deque_base::begin() + new_size, deque_base::end()); - else if (new_size > deque_base::size()) - deque_base::insert(deque_base::end(), new_size - deque_base::size(), x); - } -#endif - }; -} - -#endif // check whether specialization is actually required - #endif // EIGEN_STDDEQUE_H diff --git a/Eigen/src/StlSupport/StdList.h b/Eigen/src/StlSupport/StdList.h index 6070e951b..da36677a2 100644 --- a/Eigen/src/StlSupport/StdList.h +++ b/Eigen/src/StlSupport/StdList.h @@ -47,64 +47,4 @@ namespace std \ }; \ } -// check whether we really need the std::list specialization -#if !EIGEN_HAS_CXX11_CONTAINERS && !(defined(_GLIBCXX_LIST) && (!EIGEN_GNUC_AT_LEAST(4,1))) /* Note that before gcc-4.1 we already have: std::list::resize(size_type,const T&). */ - -namespace std -{ - -#define EIGEN_STD_LIST_SPECIALIZATION_BODY \ - public: \ - typedef T value_type; \ - typedef typename list_base::allocator_type allocator_type; \ - typedef typename list_base::size_type size_type; \ - typedef typename list_base::iterator iterator; \ - typedef typename list_base::const_iterator const_iterator; \ - explicit list(const allocator_type& a = allocator_type()) : list_base(a) {} \ - template \ - list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \ - : list_base(first, last, a) {} \ - list(const list& c) : list_base(c) {} \ - explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \ - list(iterator start_, iterator end_) : list_base(start_, end_) {} \ - list& operator=(const list& x) { \ - list_base::operator=(x); \ - return *this; \ - } - - template - class list > - : public list > - { - typedef list > list_base; - EIGEN_STD_LIST_SPECIALIZATION_BODY - - void resize(size_type new_size) - { resize(new_size, T()); } - - void resize(size_type new_size, const value_type& x) - { - if (list_base::size() < new_size) - list_base::insert(list_base::end(), new_size - list_base::size(), x); - else - while (new_size < list_base::size()) list_base::pop_back(); - } - -#if defined(_LIST_) - // workaround MSVC std::list implementation - void push_back(const value_type& x) - { list_base::push_back(x); } - using list_base::insert; - iterator insert(const_iterator position, const value_type& x) - { return list_base::insert(position,x); } - void insert(const_iterator position, size_type new_size, const value_type& x) - { list_base::insert(position, new_size, x); } -#endif - }; -} - -#endif // check whether specialization is actually required - #endif // EIGEN_STDLIST_H diff --git a/Eigen/src/StlSupport/StdVector.h b/Eigen/src/StlSupport/StdVector.h index 93cc4a00e..02dfb3918 100644 --- a/Eigen/src/StlSupport/StdVector.h +++ b/Eigen/src/StlSupport/StdVector.h @@ -48,88 +48,4 @@ namespace std \ }; \ } -// Don't specialize if containers are implemented according to C++11 -#if !EIGEN_HAS_CXX11_CONTAINERS - -namespace std { - -#define EIGEN_STD_VECTOR_SPECIALIZATION_BODY \ - public: \ - typedef T value_type; \ - typedef typename vector_base::allocator_type allocator_type; \ - typedef typename vector_base::size_type size_type; \ - typedef typename vector_base::iterator iterator; \ - typedef typename vector_base::const_iterator const_iterator; \ - explicit vector(const allocator_type& a = allocator_type()) : vector_base(a) {} \ - template \ - vector(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \ - : vector_base(first, last, a) {} \ - vector(const vector& c) : vector_base(c) {} \ - explicit vector(size_type num, const value_type& val = value_type()) : vector_base(num, val) {} \ - vector(iterator start_, iterator end_) : vector_base(start_, end_) {} \ - vector& operator=(const vector& x) { \ - vector_base::operator=(x); \ - return *this; \ - } - - template - class vector > - : public vector > -{ - typedef vector > vector_base; - EIGEN_STD_VECTOR_SPECIALIZATION_BODY - - void resize(size_type new_size) - { resize(new_size, T()); } - -#if defined(_VECTOR_) - // workaround MSVC std::vector implementation - void resize(size_type new_size, const value_type& x) - { - if (vector_base::size() < new_size) - vector_base::_Insert_n(vector_base::end(), new_size - vector_base::size(), x); - else if (new_size < vector_base::size()) - vector_base::erase(vector_base::begin() + new_size, vector_base::end()); - } - void push_back(const value_type& x) - { vector_base::push_back(x); } - using vector_base::insert; - iterator insert(const_iterator position, const value_type& x) - { return vector_base::insert(position,x); } - void insert(const_iterator position, size_type new_size, const value_type& x) - { vector_base::insert(position, new_size, x); } -#elif defined(_GLIBCXX_VECTOR) && (!(EIGEN_GNUC_AT_LEAST(4,1))) - /* Note that before gcc-4.1 we already have: std::vector::resize(size_type,const T&). - * However, this specialization is still needed to make the above EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION trick to work. */ - void resize(size_type new_size, const value_type& x) - { - vector_base::resize(new_size,x); - } -#elif defined(_GLIBCXX_VECTOR) && EIGEN_GNUC_AT_LEAST(4,2) - // workaround GCC std::vector implementation - void resize(size_type new_size, const value_type& x) - { - if (new_size < vector_base::size()) - vector_base::_M_erase_at_end(this->_M_impl._M_start + new_size); - else - vector_base::insert(vector_base::end(), new_size - vector_base::size(), x); - } -#else - // either GCC 4.1 or non-GCC - // default implementation which should always work. - void resize(size_type new_size, const value_type& x) - { - if (new_size < vector_base::size()) - vector_base::erase(vector_base::begin() + new_size, vector_base::end()); - else if (new_size > vector_base::size()) - vector_base::insert(vector_base::end(), new_size - vector_base::size(), x); - } -#endif - }; -} -#endif // !EIGEN_HAS_CXX11_CONTAINERS - - #endif // EIGEN_STDVECTOR_H diff --git a/doc/PreprocessorDirectives.dox b/doc/PreprocessorDirectives.dox index 9d4638895..79581a5ac 100644 --- a/doc/PreprocessorDirectives.dox +++ b/doc/PreprocessorDirectives.dox @@ -55,7 +55,7 @@ By default, %Eigen strive to automatically detect and enable language features a the information provided by the compiler. - \b EIGEN_MAX_CPP_VER - disables usage of C++ features requiring a version greater than EIGEN_MAX_CPP_VER. - Possible values are: 03, 11, 14, 17, etc. If not defined (the default), %Eigen enables all features supported + Possible values are: 11, 14, 17, etc. If not defined (the default), %Eigen enables all features supported by the compiler. Individual features can be explicitly enabled or disabled by defining the following token to 0 or 1 respectively. @@ -66,18 +66,12 @@ functions by defining EIGEN_HAS_C99_MATH=1. Automatic detection disabled if EIGEN_MAX_CPP_VER<11. - \b EIGEN_HAS_CXX11_MATH - controls the implementation of some functions such as round, logp1, isinf, isnan, etc. Automatic detection disabled if EIGEN_MAX_CPP_VER<11. - - \b EIGEN_HAS_RVALUE_REFERENCES - defines whether rvalue references are supported - Automatic detection disabled if EIGEN_MAX_CPP_VER<11. - \b EIGEN_HAS_STD_RESULT_OF - defines whether std::result_of is supported Automatic detection disabled if EIGEN_MAX_CPP_VER<11. - \b EIGEN_HAS_VARIADIC_TEMPLATES - defines whether variadic templates are supported Automatic detection disabled if EIGEN_MAX_CPP_VER<11. - \b EIGEN_HAS_CONSTEXPR - defines whether relaxed const expression are supported Automatic detection disabled if EIGEN_MAX_CPP_VER<14. - - \b EIGEN_HAS_CXX11_CONTAINERS - defines whether STL's containers follows C++11 specifications - Automatic detection disabled if EIGEN_MAX_CPP_VER<11. - - \b EIGEN_HAS_CXX11_NOEXCEPT - defines whether noexcept is supported - Automatic detection disabled if EIGEN_MAX_CPP_VER<11. - \b EIGEN_NO_IO - Disables any usage and support for ``. \section TopicPreprocessorDirectivesAssertions Assertions diff --git a/doc/examples/nullary_indexing.cpp b/doc/examples/nullary_indexing.cpp index b74db5fd1..f710c84cc 100644 --- a/doc/examples/nullary_indexing.cpp +++ b/doc/examples/nullary_indexing.cpp @@ -56,11 +56,9 @@ int main() B = mat_indexing(A, ri+1, ci); std::cout << "A(ri+1,ci) =" << std::endl; std::cout << B << std::endl << std::endl; -#if EIGEN_COMP_CXXVER >= 11 B = mat_indexing(A, ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)); std::cout << "A(ArrayXi::LinSpaced(13,0,12).unaryExpr([](int x){return x%4;}), ArrayXi::LinSpaced(4,0,3)) =" << std::endl; std::cout << B << std::endl << std::endl; -#endif std::cout << "[main2]\n"; } diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index c561fc89d..34404c2a4 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -293,8 +293,6 @@ template void check_const_correctness(const PlainObjec VERIFY( !(Map::Flags & LvalueBit) ); } -#if EIGEN_HAS_RVALUE_REFERENCES - // Regression for bug 1573 struct MovableClass { // The following line is a workaround for gcc 4.7 and 4.8 (see bug 1573 comments). @@ -307,8 +305,6 @@ struct MovableClass { Quaternionf m_quat; }; -#endif - EIGEN_DECLARE_TEST(geo_quaternion) { for(int i = 0; i < g_repeat; i++) { diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 61504815f..0600ddb55 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -847,7 +847,7 @@ void packetmath_real() { } } -#if EIGEN_HAS_C99_MATH && (EIGEN_COMP_CXXVER >= 11) +#if EIGEN_HAS_C99_MATH data1[0] = NumTraits::infinity(); data1[1] = Scalar(-1); CHECK_CWISE1_IF(PacketTraits::HasLog1p, std::log1p, internal::plog1p); diff --git a/test/rvalue_types.cpp b/test/rvalue_types.cpp index 5f548894b..9af7c9287 100644 --- a/test/rvalue_types.cpp +++ b/test/rvalue_types.cpp @@ -17,7 +17,6 @@ using internal::UIntPtr; -#if EIGEN_HAS_RVALUE_REFERENCES template void rvalue_copyassign(const MatrixType& m) { @@ -112,14 +111,6 @@ void rvalue_move(const MatrixType& m) g_dst = std::move(g_src); VERIFY_IS_EQUAL(g_dst, m); } -#else -template -void rvalue_copyassign(const MatrixType&) {} -template -void rvalue_transpositions(Index) {} -template -void rvalue_move(const MatrixType&) {} -#endif EIGEN_DECLARE_TEST(rvalue_types) { diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index 93c30a5ed..85a607700 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -413,10 +413,8 @@ template void sparse_basic(const SparseMatrixType& re m.setFromTriplets(triplets.begin(), triplets.end(), std::multiplies()); VERIFY_IS_APPROX(m, refMat_prod); -#if (EIGEN_COMP_CXXVER >= 11) m.setFromTriplets(triplets.begin(), triplets.end(), [] (Scalar,Scalar b) { return b; }); VERIFY_IS_APPROX(m, refMat_last); -#endif } // test Map diff --git a/unsupported/Eigen/CXX11/ThreadPool b/unsupported/Eigen/CXX11/ThreadPool index c6be19bef..6ebe9e779 100644 --- a/unsupported/Eigen/CXX11/ThreadPool +++ b/unsupported/Eigen/CXX11/ThreadPool @@ -30,7 +30,6 @@ // The code depends on CXX11, so only include the module if the // compiler supports it. -#if (EIGEN_COMP_CXXVER >= 11) #include #include #include @@ -67,8 +66,6 @@ #include "src/ThreadPool/Barrier.h" #include "src/ThreadPool/NonBlockingThreadPool.h" -#endif - #include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h" #endif // EIGEN_CXX11_THREADPOOL_MODULE_H diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h index 26358d545..5a14c71eb 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h @@ -402,7 +402,6 @@ class Tensor : public TensorBase::run(assign, DefaultDevice()); } - #if EIGEN_HAS_RVALUE_REFERENCES EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Self&& other) : m_storage(std::move(other.m_storage)) @@ -414,7 +413,6 @@ class Tensor : public TensorBase EIGEN_DEVICE_FUNC diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h index 5ec81a672..2dff54342 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h @@ -110,7 +110,6 @@ class TensorStorage, Options_> return *this; } -#if EIGEN_HAS_RVALUE_REFERENCES EIGEN_DEVICE_FUNC TensorStorage(Self&& other) : TensorStorage() { *this = std::move(other); @@ -122,7 +121,6 @@ class TensorStorage, Options_> numext::swap(m_dimensions, other.m_dimensions); return *this; } -#endif EIGEN_DEVICE_FUNC ~TensorStorage() { internal::conditional_aligned_delete_auto(m_data, internal::array_prod(m_dimensions)); } EIGEN_DEVICE_FUNC void swap(Self& other) diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h b/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h index 720fc4929..366bf1e66 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h @@ -18,8 +18,7 @@ #else -#if EIGEN_MAX_CPP_VER >= 11 && \ - ((EIGEN_COMP_GNUC && EIGEN_GNUC_AT_LEAST(4, 8)) || \ +#if ((EIGEN_COMP_GNUC && EIGEN_GNUC_AT_LEAST(4, 8)) || \ __has_feature(cxx_thread_local) || \ (EIGEN_COMP_MSVC >= 1900) ) #define EIGEN_THREAD_LOCAL static thread_local diff --git a/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h b/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h index 056736c39..386e390dc 100644 --- a/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h +++ b/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h @@ -27,18 +27,6 @@ #error GNU C++ Compiler (g++) only supports required C++ features since version 4.6. #endif -/* Check that the compiler at least claims to support C++11. It might not be sufficient - * because the compiler may not implement it correctly, but at least we'll know. - * On the other hand, visual studio still doesn't claim to support C++11 although it's - * compliant enugh for our purpose. - */ -#if (EIGEN_COMP_CXXVER < 11) -#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) -#pragma GCC diagnostic error "-Wfatal-errors" -#endif -#error This library needs at least a C++11 compliant compiler. If you use g++/clang, please enable the -std=c++11 compiler flag. (-std=c++0x on older versions.) -#endif - namespace Eigen { namespace internal { diff --git a/unsupported/test/special_packetmath.cpp b/unsupported/test/special_packetmath.cpp index 31233f1b0..faf10ef72 100644 --- a/unsupported/test/special_packetmath.cpp +++ b/unsupported/test/special_packetmath.cpp @@ -114,7 +114,7 @@ template void packetmath_real() Scalar(std::pow(Scalar(10), internal::random(Scalar(-1),Scalar(2)))); } -#if EIGEN_HAS_C99_MATH && (EIGEN_COMP_CXXVER >= 11) +#if EIGEN_HAS_C99_MATH CHECK_CWISE1_IF(internal::packet_traits::HasLGamma, std::lgamma, internal::plgamma); CHECK_CWISE1_IF(internal::packet_traits::HasErf, std::erf, internal::perf); CHECK_CWISE1_IF(internal::packet_traits::HasErfc, std::erfc, internal::perfc);