Modernize internal utilities for C++14 libeigen/eigen!2490
diff --git a/Eigen/Core b/Eigen/Core index 2fec8f3..060c92b 100644 --- a/Eigen/Core +++ b/Eigen/Core
@@ -96,6 +96,9 @@ // for std::is_nothrow_move_assignable #include <type_traits> +// for std::move, std::forward, std::declval +#include <utility> + // for std::this_thread::yield(). #if !defined(EIGEN_USE_BLAS) && (defined(EIGEN_HAS_OPENMP) || defined(EIGEN_GEMM_THREADPOOL)) #include <thread> @@ -139,7 +142,6 @@ #include <CL/sycl.hpp> #include <map> #include <thread> -#include <utility> #ifndef EIGEN_SYCL_LOCAL_THREAD_DIM0 #define EIGEN_SYCL_LOCAL_THREAD_DIM0 16 #endif
diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index 0d70119..ef1642c 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h
@@ -119,9 +119,8 @@ using ExpressionTraits = traits<ExpressionType>; enum { Alignment = 0 }; - // noncopyable: - // Don't make this class inherit noncopyable as this kills EBO (Empty Base Optimization) - // and make complex evaluator much larger than then should do. + // Spell out deleted copy operations instead of inheriting from an empty helper: + // an extra base can kill EBO and make complex evaluators larger than they should be. EIGEN_DEVICE_FUNC constexpr evaluator_base() = default; evaluator_base(const evaluator_base&) = delete;
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 4b0ca97..83e2214 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h
@@ -1376,7 +1376,7 @@ // T is assumed to be an integer type with a>=0, and b>0 template <typename T> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE constexpr T div_ceil(T a, T b) { - using UnsignedT = typename internal::make_unsigned<T>::type; + using UnsignedT = std::make_unsigned_t<T>; EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES) // Note: explicitly declaring a and b as non-negative values allows the compiler to use better optimizations const UnsignedT ua = UnsignedT(a); @@ -1389,8 +1389,8 @@ // T is assumed to be an integer type with a>=0, and b>0 template <typename T, typename U> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE constexpr T round_down(T a, U b) { - using UnsignedT = typename internal::make_unsigned<T>::type; - using UnsignedU = typename internal::make_unsigned<U>::type; + using UnsignedT = std::make_unsigned_t<T>; + using UnsignedU = std::make_unsigned_t<U>; EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES) EIGEN_STATIC_ASSERT((NumTraits<U>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES) // Note: explicitly declaring a and b as non-negative values allows the compiler to use better optimizations
diff --git a/Eigen/src/Core/arch/AVX512/TrsmKernel.h b/Eigen/src/Core/arch/AVX512/TrsmKernel.h index 11c0bd7..fffedb6 100644 --- a/Eigen/src/Core/arch/AVX512/TrsmKernel.h +++ b/Eigen/src/Core/arch/AVX512/TrsmKernel.h
@@ -227,7 +227,7 @@ constexpr int64_t U3 = urolls::PacketSize * 3; constexpr int64_t U2 = urolls::PacketSize * 2; constexpr int64_t U1 = urolls::PacketSize * 1; - using vec = typename std::conditional<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>::type; + using vec = std::conditional_t<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>; int64_t N_ = (N / U3) * U3; int64_t M_ = (M / EIGEN_AVX_MAX_NUM_ROW) * EIGEN_AVX_MAX_NUM_ROW; int64_t K_ = (K / EIGEN_AVX_MAX_K_UNROL) * EIGEN_AVX_MAX_K_UNROL; @@ -785,7 +785,7 @@ void triSolveKernelLxK(Scalar* A_arr, Scalar* B_arr, int64_t M, int64_t K, int64_t LDA, int64_t LDB) { // Note: this assumes EIGEN_AVX_MAX_NUM_ROW = 8. Unrolls should be adjusted // accordingly if EIGEN_AVX_MAX_NUM_ROW is smaller. - using vec = typename std::conditional<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>::type; + using vec = std::conditional_t<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>; if (M == 8) triSolveKernel<Scalar, vec, 8, isARowMajor, isFWDSolve, isUnitDiag>(A_arr, B_arr, K, LDA, LDB); else if (M == 7) @@ -817,7 +817,7 @@ int64_t remM_ = 0) { EIGEN_UNUSED_VARIABLE(remM_); using urolls = unrolls::transB<Scalar>; - using vecHalf = typename std::conditional<std::is_same<Scalar, float>::value, vecHalfFloat, vecFullDouble>::type; + using vecHalf = std::conditional_t<std::is_same<Scalar, float>::value, vecHalfFloat, vecFullDouble>; PacketBlock<vecHalf, EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS> ymm; constexpr int64_t U3 = urolls::PacketSize * 3; constexpr int64_t U2 = urolls::PacketSize * 2;
diff --git a/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc b/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc index 3a5f68e..3ca8b2d 100644 --- a/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +++ b/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc
@@ -129,8 +129,8 @@ template <typename Scalar> class trans { public: - using vec = typename std::conditional<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>::type; - using vecHalf = typename std::conditional<std::is_same<Scalar, float>::value, vecHalfFloat, vecFullDouble>::type; + using vec = std::conditional_t<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>; + using vecHalf = std::conditional_t<std::is_same<Scalar, float>::value, vecHalfFloat, vecFullDouble>; static constexpr int64_t PacketSize = packet_traits<Scalar>::size; /*********************************** @@ -281,8 +281,8 @@ template <typename Scalar> class transB { public: - using vec = typename std::conditional<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>::type; - using vecHalf = typename std::conditional<std::is_same<Scalar, float>::value, vecHalfFloat, vecFullDouble>::type; + using vec = std::conditional_t<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>; + using vecHalf = std::conditional_t<std::is_same<Scalar, float>::value, vecHalfFloat, vecFullDouble>; static constexpr int64_t PacketSize = packet_traits<Scalar>::size; /*********************************** @@ -585,7 +585,7 @@ template <typename Scalar> class trsm { public: - using vec = typename std::conditional<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>::type; + using vec = std::conditional_t<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>; static constexpr int64_t PacketSize = packet_traits<Scalar>::size; /*********************************** @@ -864,7 +864,7 @@ template <typename Scalar, bool isAdd> class gemm { public: - using vec = typename std::conditional<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>::type; + using vec = std::conditional_t<std::is_same<Scalar, float>::value, vecFullFloat, vecFullDouble>; static constexpr int64_t PacketSize = packet_traits<Scalar>::size; /***********************************
diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h index ab02d32..4815974 100644 --- a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +++ b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h
@@ -490,7 +490,7 @@ const Packet pAlpha = pset1<Packet>(alpha); const Packet pMask = bmask<Packet>(remaining_rows); - typedef typename std::conditional_t<(sizeof(Scalar) == sizeof(float)), RhsPacket, __vector_pair> RhsPacket2; + typedef std::conditional_t<(sizeof(Scalar) == sizeof(float)), RhsPacket, __vector_pair> RhsPacket2; Index col = 0; #ifdef GEMM_MULTIPLE_COLS @@ -869,7 +869,7 @@ const Scalar* blockA = (Scalar*)blockAc; const Scalar* blockB = (Scalar*)blockBc; - typedef typename std::conditional_t<(sizeof(Scalar) == sizeof(float)), RhsPacket, __vector_pair> RhsPacket2; + typedef std::conditional_t<(sizeof(Scalar) == sizeof(float)), RhsPacket, __vector_pair> RhsPacket2; Index col = 0; #ifdef GEMM_MULTIPLE_COLS
diff --git a/Eigen/src/Core/arch/GPU/Tuple.h b/Eigen/src/Core/arch/GPU/Tuple.h index 0e74487..e9b608c 100644 --- a/Eigen/src/Core/arch/GPU/Tuple.h +++ b/Eigen/src/Core/arch/GPU/Tuple.h
@@ -187,7 +187,7 @@ // For use in make_tuple, decays a type and unwraps a reference_wrapper. template <typename T> struct unwrap_decay { - using type = typename unwrap_reference_wrapper<typename std::decay<T>::type>::type; + using type = typename unwrap_reference_wrapper<std::decay_t<T>>::type; }; /** @@ -223,12 +223,12 @@ * \param tuples ... list of tuples. * \return concatenated tuple. */ -template <typename... Tuples, typename EnableIf = std::enable_if_t< - internal::reduce_all<is_tuple<typename std::decay<Tuples>::type>::value...>::value>> +template <typename... Tuples, + typename EnableIf = std::enable_if_t<internal::reduce_all<is_tuple<std::decay_t<Tuples>>::value...>::value>> constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename tuple_cat_impl<sizeof...(Tuples), typename std::decay<Tuples>::type...>::ReturnType + typename tuple_cat_impl<sizeof...(Tuples), std::decay_t<Tuples>...>::ReturnType tuple_cat(Tuples&&... tuples) { - return tuple_cat_impl<sizeof...(Tuples), typename std::decay<Tuples>::type...>::run(std::forward<Tuples>(tuples)...); + return tuple_cat_impl<sizeof...(Tuples), std::decay_t<Tuples>...>::run(std::forward<Tuples>(tuples)...); } /**
diff --git a/Eigen/src/Core/arch/RVV10/PacketMath2.h b/Eigen/src/Core/arch/RVV10/PacketMath2.h index d99a154..ccf496b 100644 --- a/Eigen/src/Core/arch/RVV10/PacketMath2.h +++ b/Eigen/src/Core/arch/RVV10/PacketMath2.h
@@ -262,8 +262,7 @@ template <typename Packet = Packet4Xi> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet4Xi>::value && (unpacket_traits<Packet4Xi>::size % 8) == 0, - Packet2Xi>::type + std::enable_if_t<std::is_same<Packet, Packet4Xi>::value && (unpacket_traits<Packet4Xi>::size % 8) == 0, Packet2Xi> predux_half(const Packet4Xi& a) { return __riscv_vadd_vv_i32m2(__riscv_vget_v_i32m4_i32m2(a, 0), __riscv_vget_v_i32m4_i32m2(a, 1), unpacket_traits<Packet2Xi>::size); @@ -271,8 +270,7 @@ template <typename Packet = Packet2Xi> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet2Xi>::value && (unpacket_traits<Packet2Xi>::size % 8) == 0, - Packet1Xi>::type + std::enable_if_t<std::is_same<Packet, Packet2Xi>::value && (unpacket_traits<Packet2Xi>::size % 8) == 0, Packet1Xi> predux_half(const Packet2Xi& a) { return __riscv_vadd_vv_i32m1(__riscv_vget_v_i32m2_i32m1(a, 0), __riscv_vget_v_i32m2_i32m1(a, 1), unpacket_traits<Packet1Xi>::size); @@ -629,8 +627,7 @@ template <typename Packet = Packet4Xf> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet4Xf>::value && (unpacket_traits<Packet4Xf>::size % 8) == 0, - Packet2Xf>::type + std::enable_if_t<std::is_same<Packet, Packet4Xf>::value && (unpacket_traits<Packet4Xf>::size % 8) == 0, Packet2Xf> predux_half(const Packet4Xf& a) { return __riscv_vfadd_vv_f32m2(__riscv_vget_v_f32m4_f32m2(a, 0), __riscv_vget_v_f32m4_f32m2(a, 1), unpacket_traits<Packet2Xf>::size); @@ -638,8 +635,7 @@ template <typename Packet = Packet2Xf> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet2Xf>::value && (unpacket_traits<Packet2Xf>::size % 8) == 0, - Packet1Xf>::type + std::enable_if_t<std::is_same<Packet, Packet2Xf>::value && (unpacket_traits<Packet2Xf>::size % 8) == 0, Packet1Xf> predux_half(const Packet2Xf& a) { return __riscv_vfadd_vv_f32m1(__riscv_vget_v_f32m2_f32m1(a, 0), __riscv_vget_v_f32m2_f32m1(a, 1), unpacket_traits<Packet1Xf>::size); @@ -889,8 +885,7 @@ template <typename Packet = Packet4Xl> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet4Xl>::value && (unpacket_traits<Packet4Xl>::size % 8) == 0, - Packet2Xl>::type + std::enable_if_t<std::is_same<Packet, Packet4Xl>::value && (unpacket_traits<Packet4Xl>::size % 8) == 0, Packet2Xl> predux_half(const Packet4Xl& a) { return __riscv_vadd_vv_i64m2(__riscv_vget_v_i64m4_i64m2(a, 0), __riscv_vget_v_i64m4_i64m2(a, 1), unpacket_traits<Packet2Xl>::size); @@ -898,8 +893,7 @@ template <typename Packet = Packet2Xl> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet2Xl>::value && (unpacket_traits<Packet2Xl>::size % 8) == 0, - Packet1Xl>::type + std::enable_if_t<std::is_same<Packet, Packet2Xl>::value && (unpacket_traits<Packet2Xl>::size % 8) == 0, Packet1Xl> predux_half(const Packet2Xl& a) { return __riscv_vadd_vv_i64m1(__riscv_vget_v_i64m2_i64m1(a, 0), __riscv_vget_v_i64m2_i64m1(a, 1), unpacket_traits<Packet1Xl>::size); @@ -1254,8 +1248,7 @@ template <typename Packet = Packet4Xd> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet4Xd>::value && (unpacket_traits<Packet4Xd>::size % 8) == 0, - Packet2Xd>::type + std::enable_if_t<std::is_same<Packet, Packet4Xd>::value && (unpacket_traits<Packet4Xd>::size % 8) == 0, Packet2Xd> predux_half(const Packet4Xd& a) { return __riscv_vfadd_vv_f64m2(__riscv_vget_v_f64m4_f64m2(a, 0), __riscv_vget_v_f64m4_f64m2(a, 1), unpacket_traits<Packet2Xd>::size); @@ -1263,8 +1256,7 @@ template <typename Packet = Packet2Xd> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet2Xd>::value && (unpacket_traits<Packet2Xd>::size % 8) == 0, - Packet1Xd>::type + std::enable_if_t<std::is_same<Packet, Packet2Xd>::value && (unpacket_traits<Packet2Xd>::size % 8) == 0, Packet1Xd> predux_half(const Packet2Xd& a) { return __riscv_vfadd_vv_f64m1(__riscv_vget_v_f64m2_f64m1(a, 0), __riscv_vget_v_f64m2_f64m1(a, 1), unpacket_traits<Packet1Xd>::size); @@ -1515,8 +1507,7 @@ template <typename Packet = Packet4Xs> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet4Xs>::value && (unpacket_traits<Packet4Xs>::size % 8) == 0, - Packet2Xs>::type + std::enable_if_t<std::is_same<Packet, Packet4Xs>::value && (unpacket_traits<Packet4Xs>::size % 8) == 0, Packet2Xs> predux_half(const Packet4Xs& a) { return __riscv_vadd_vv_i16m2(__riscv_vget_v_i16m4_i16m2(a, 0), __riscv_vget_v_i16m4_i16m2(a, 1), unpacket_traits<Packet2Xs>::size); @@ -1524,8 +1515,7 @@ template <typename Packet = Packet2Xs> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet2Xs>::value && (unpacket_traits<Packet2Xs>::size % 8) == 0, - Packet1Xs>::type + std::enable_if_t<std::is_same<Packet, Packet2Xs>::value && (unpacket_traits<Packet2Xs>::size % 8) == 0, Packet1Xs> predux_half(const Packet2Xs& a) { return __riscv_vadd_vv_i16m1(__riscv_vget_v_i16m2_i16m1(a, 0), __riscv_vget_v_i16m2_i16m1(a, 1), unpacket_traits<Packet1Xs>::size);
diff --git a/Eigen/src/Core/arch/RVV10/PacketMathBF16.h b/Eigen/src/Core/arch/RVV10/PacketMathBF16.h index 2522efd..8e15b21 100644 --- a/Eigen/src/Core/arch/RVV10/PacketMathBF16.h +++ b/Eigen/src/Core/arch/RVV10/PacketMathBF16.h
@@ -806,10 +806,9 @@ } template <typename Packet = Packet2Xbf> -EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet2Xbf>::value && (unpacket_traits<Packet2Xbf>::size % 8) == 0, - Packet1Xbf>::type - predux_half(const Packet2Xbf& a) { +EIGEN_STRONG_INLINE std::enable_if_t< + std::is_same<Packet, Packet2Xbf>::value && (unpacket_traits<Packet2Xbf>::size % 8) == 0, Packet1Xbf> +predux_half(const Packet2Xbf& a) { return padd<Packet1Xbf>(__riscv_vget_v_bf16m2_bf16m1(a, 0), __riscv_vget_v_bf16m2_bf16m1(a, 1)); }
diff --git a/Eigen/src/Core/arch/RVV10/PacketMathFP16.h b/Eigen/src/Core/arch/RVV10/PacketMathFP16.h index 73118a3..b1113c9 100644 --- a/Eigen/src/Core/arch/RVV10/PacketMathFP16.h +++ b/Eigen/src/Core/arch/RVV10/PacketMathFP16.h
@@ -886,8 +886,7 @@ template <typename Packet = Packet2Xh> EIGEN_STRONG_INLINE - typename std::enable_if<std::is_same<Packet, Packet2Xh>::value && (unpacket_traits<Packet2Xh>::size % 8) == 0, - Packet1Xh>::type + std::enable_if_t<std::is_same<Packet, Packet2Xh>::value && (unpacket_traits<Packet2Xh>::size % 8) == 0, Packet1Xh> predux_half(const Packet2Xh& a) { return __riscv_vfadd_vv_f16m1(__riscv_vget_v_f16m2_f16m1(a, 0), __riscv_vget_v_f16m2_f16m1(a, 1), unpacket_traits<Packet1Xh>::size);
diff --git a/Eigen/src/Core/products/SelfadjointRank2Update.h b/Eigen/src/Core/products/SelfadjointRank2Update.h index d052dfb..165875f 100644 --- a/Eigen/src/Core/products/SelfadjointRank2Update.h +++ b/Eigen/src/Core/products/SelfadjointRank2Update.h
@@ -188,7 +188,7 @@ template <bool Cond, typename T> using conj_expr_if = - std::conditional<!Cond, const T&, CwiseUnaryOp<scalar_conjugate_op<typename traits<T>::Scalar>, T>>; + std::conditional_t<!Cond, const T&, CwiseUnaryOp<scalar_conjugate_op<typename traits<T>::Scalar>, T>>; } // end namespace internal
diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index 233e58f..7059139 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h
@@ -160,7 +160,7 @@ class RefBase; template <typename PlainObjectType, int Options = 0, typename StrideType = - typename std::conditional_t<PlainObjectType::IsVectorAtCompileTime, InnerStride<1>, OuterStride<>>> + std::conditional_t<PlainObjectType::IsVectorAtCompileTime, InnerStride<1>, OuterStride<>>> class Ref; template <typename ViewOp, typename MatrixType, typename StrideType = Stride<0, 0>> class CwiseUnaryView;
diff --git a/Eigen/src/Core/util/IndexedViewHelper.h b/Eigen/src/Core/util/IndexedViewHelper.h index 82dd8a5..1c9e35d 100644 --- a/Eigen/src/Core/util/IndexedViewHelper.h +++ b/Eigen/src/Core/util/IndexedViewHelper.h
@@ -434,9 +434,8 @@ using ColMajorReturnType = IndexedView<Derived, IvcType<Indices, Derived::SizeAtCompileTime>, ZeroIndex>; using ConstColMajorReturnType = IndexedView<const Derived, IvcType<Indices, Derived::SizeAtCompileTime>, ZeroIndex>; - using ReturnType = typename internal::conditional<IsRowMajor, RowMajorReturnType, ColMajorReturnType>::type; - using ConstReturnType = - typename internal::conditional<IsRowMajor, ConstRowMajorReturnType, ConstColMajorReturnType>::type; + using ReturnType = std::conditional_t<IsRowMajor, RowMajorReturnType, ColMajorReturnType>; + using ConstReturnType = std::conditional_t<IsRowMajor, ConstRowMajorReturnType, ConstColMajorReturnType>; template <bool UseRowMajor = IsRowMajor, std::enable_if_t<UseRowMajor, bool> = true> static inline RowMajorReturnType run(Derived& derived, const Indices& indices) {
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index e51fe38..c08489a 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h
@@ -729,12 +729,12 @@ // // With MSVC, without defining /Zc:__cplusplus, the __cplusplus macro will // report 199711L regardless of the language standard specified via /std. -// We need to rely on _MSVC_LANG instead, which is only available after -// VS2015.3. +// We need to rely on _MSVC_LANG instead where available. Older MSVC versions +// supported by Eigen do not define _MSVC_LANG, so use Eigen's minimum standard. #if EIGEN_COMP_MSVC_LANG > 0 #define EIGEN_CPLUSPLUS EIGEN_COMP_MSVC_LANG #elif EIGEN_COMP_MSVC >= 1900 -#define EIGEN_CPLUSPLUS 201103L +#define EIGEN_CPLUSPLUS 201402L #elif defined(__cplusplus) #define EIGEN_CPLUSPLUS __cplusplus #else @@ -750,10 +750,8 @@ #define EIGEN_COMP_CXXVER 17 #elif EIGEN_CPLUSPLUS >= 201402L #define EIGEN_COMP_CXXVER 14 -#elif EIGEN_CPLUSPLUS >= 201103L -#define EIGEN_COMP_CXXVER 11 #else -#define EIGEN_COMP_CXXVER 03 +#define EIGEN_COMP_CXXVER 0 #endif // The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 87b5242..c52137d 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h
@@ -634,11 +634,6 @@ } }; -template <typename T> -EIGEN_DEVICE_FUNC T* smart_move(T* start, T* end, T* target) { - return std::move(start, end, target); -} - /***************************************************************************** *** Implementation of runtime stack allocation (falling back to malloc) *** *****************************************************************************/ @@ -665,8 +660,11 @@ // This helper class construct the allocated memory, and takes care of destructing and freeing the handled data // at destruction time. In practice this helper class is mainly useful to avoid memory leak in case of exceptions. template <typename T> -class aligned_stack_memory_handler : noncopyable { +class aligned_stack_memory_handler { public: + aligned_stack_memory_handler(const aligned_stack_memory_handler&) = delete; + aligned_stack_memory_handler& operator=(const aligned_stack_memory_handler&) = delete; + /* Creates a stack_memory_handler responsible for the buffer \a ptr of size \a size. * Note that \a ptr can be 0 regardless of the other parameters. * This constructor takes care of constructing/initializing the elements of the buffer if required by the scalar type @@ -733,25 +731,6 @@ #endif // EIGEN_ALLOCA -template <typename T> -class scoped_array : noncopyable { - T* m_ptr; - - public: - explicit scoped_array(std::ptrdiff_t size) { m_ptr = new T[size]; } - ~scoped_array() { delete[] m_ptr; } - T& operator[](std::ptrdiff_t i) { return m_ptr[i]; } - const T& operator[](std::ptrdiff_t i) const { return m_ptr[i]; } - T*& ptr() { return m_ptr; } - const T* ptr() const { return m_ptr; } - operator const T*() const { return m_ptr; } -}; - -template <typename T> -void swap(scoped_array<T>& a, scoped_array<T>& b) { - std::swap(a.ptr(), b.ptr()); -} - } // end namespace internal /** \internal
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 848d90d..d78df80 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h
@@ -197,18 +197,6 @@ using std::is_convertible; /** \internal - * A base class do disable default copy ctor and copy assignment operator. - */ -class noncopyable { - EIGEN_DEVICE_FUNC noncopyable(const noncopyable&); - EIGEN_DEVICE_FUNC const noncopyable& operator=(const noncopyable&); - - protected: - EIGEN_DEVICE_FUNC noncopyable() {} - EIGEN_DEVICE_FUNC ~noncopyable() {} -}; - -/** \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). * @@ -301,24 +289,12 @@ typedef typename std::invoke_result<F, ArgTypes...>::type type1; typedef remove_all_t<type1> type; }; - -template <typename F, typename... ArgTypes> -struct invoke_result { - typedef typename std::invoke_result<F, ArgTypes...>::type type1; - typedef remove_all_t<type1> type; -}; #else template <typename T> struct result_of { typedef typename std::result_of<T>::type type1; typedef remove_all_t<type1> type; }; - -template <typename F, typename... ArgTypes> -struct invoke_result { - typedef typename result_of<F(ArgTypes...)>::type type1; - typedef remove_all_t<type1> type; -}; #endif // Reduces a sequence of bools to true if all are true, false otherwise. @@ -326,82 +302,35 @@ using reduce_all = std::is_same<std::integer_sequence<bool, values..., true>, std::integer_sequence<bool, true, values...>>; -// Reduces a sequence of bools to true if any are true, false if all false. -template <bool... values> -using reduce_any = std::integral_constant<bool, !std::is_same<std::integer_sequence<bool, values..., false>, - std::integer_sequence<bool, false, values...>>::value>; - -struct meta_yes { - char a[1]; -}; -struct meta_no { - char a[2]; -}; - // Check whether T::ReturnType does exist -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(...); - - enum { value = sizeof(testFunctor<T>(static_cast<T*>(0))) == sizeof(meta_yes) }; -}; +template <typename T, typename EnableIf = void> +struct has_ReturnType : false_type {}; template <typename T> -const T* return_ptr(); +struct has_ReturnType<T, void_t<typename T::ReturnType>> : true_type {}; -template <typename T, typename IndexType = Index> -struct has_nullary_operator { - template <typename C> - static meta_yes testFunctor(C const*, std::enable_if_t<(sizeof(return_ptr<C>()->operator()()) > 0)>* = 0); - static meta_no testFunctor(...); +template <typename T, typename IndexType = Index, typename EnableIf = void> +struct has_nullary_operator : false_type {}; - enum { value = sizeof(testFunctor(static_cast<T*>(0))) == sizeof(meta_yes) }; -}; +template <typename T, typename IndexType> +struct has_nullary_operator<T, IndexType, std::enable_if_t<(sizeof(decltype(std::declval<const T&>()())) > 0)>> + : true_type {}; -template <typename T, typename IndexType = Index> -struct has_unary_operator { - template <typename C> - static meta_yes testFunctor(C const*, std::enable_if_t<(sizeof(return_ptr<C>()->operator()(IndexType(0))) > 0)>* = 0); - static meta_no testFunctor(...); +template <typename T, typename IndexType = Index, typename EnableIf = void> +struct has_unary_operator : false_type {}; - enum { value = sizeof(testFunctor(static_cast<T*>(0))) == sizeof(meta_yes) }; -}; +template <typename T, typename IndexType> +struct has_unary_operator<T, IndexType, + std::enable_if_t<(sizeof(decltype(std::declval<const T&>()(IndexType(0)))) > 0)>> + : true_type {}; -template <typename T, typename IndexType = Index> -struct has_binary_operator { - template <typename C> - static meta_yes testFunctor( - C const*, std::enable_if_t<(sizeof(return_ptr<C>()->operator()(IndexType(0), IndexType(0))) > 0)>* = 0); - static meta_no testFunctor(...); +template <typename T, typename IndexType = Index, typename EnableIf = void> +struct has_binary_operator : false_type {}; - enum { value = sizeof(testFunctor(static_cast<T*>(0))) == sizeof(meta_yes) }; -}; - -/** \internal In short, it computes int(sqrt(\a Y)) with \a Y an integer. - * Usage example: \code meta_sqrt<1023>::ret \endcode - */ -template <int Y, int InfX = 0, int SupX = ((Y == 1) ? 1 : Y / 2), - bool Done = ((SupX - InfX) <= 1 || ((SupX * SupX <= Y) && ((SupX + 1) * (SupX + 1) > Y)))> -class meta_sqrt { - enum { - MidX = (InfX + SupX) / 2, - TakeInf = MidX * MidX > Y ? 1 : 0, - NewInf = int(TakeInf) ? InfX : int(MidX), - NewSup = int(TakeInf) ? int(MidX) : SupX - }; - - public: - enum { ret = meta_sqrt<Y, NewInf, NewSup>::ret }; -}; - -template <int Y, int InfX, int SupX> -class meta_sqrt<Y, InfX, SupX, true> { - public: - enum { ret = (SupX * SupX <= Y) ? SupX : InfX }; -}; +template <typename T, typename IndexType> +struct has_binary_operator< + T, IndexType, std::enable_if_t<(sizeof(decltype(std::declval<const T&>()(IndexType(0), IndexType(0)))) > 0)>> + : true_type {}; /** \internal Computes the least common multiple of two positive integer A and B * at compile-time. @@ -469,7 +398,7 @@ // X is an unsigned integer // Y is a signed integer // if Y is non-negative, it may be represented exactly as its unsigned counterpart. - using UnsignedY = typename internal::make_unsigned<Y>::type; + using UnsignedY = std::make_unsigned_t<Y>; static constexpr EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool run(const X& x, const Y& y) { return y < Y(0) ? false : (x == static_cast<UnsignedY>(y)); } @@ -637,20 +566,6 @@ } template <typename A, typename B> -constexpr bool enum_le_not_dynamic(A a, B b) { - plain_enum_asserts(a, b); - if ((int)a == Dynamic || (int)b == Dynamic) return false; - return (int)a <= (int)b; -} - -template <typename A, typename B> -constexpr bool enum_gt_not_dynamic(A a, B b) { - plain_enum_asserts(a, b); - if ((int)a == Dynamic || (int)b == Dynamic) return false; - return (int)a > (int)b; -} - -template <typename A, typename B> constexpr bool enum_ge_not_dynamic(A a, B b) { plain_enum_asserts(a, b); if ((int)a == Dynamic || (int)b == Dynamic) return false;
diff --git a/Eigen/src/Core/util/MoreMeta.h b/Eigen/src/Core/util/MoreMeta.h index a20506e..4f83167 100644 --- a/Eigen/src/Core/util/MoreMeta.h +++ b/Eigen/src/Core/util/MoreMeta.h
@@ -368,64 +368,15 @@ return a && b; } }; -struct logical_or_op { - template <typename A, typename B> - constexpr static auto run(A a, B b) -> decltype(a || b) { - return a || b; - } -}; - -struct equal_op { - template <typename A, typename B> - constexpr static auto run(A a, B b) -> decltype(a == b) { - return a == b; - } -}; -struct not_equal_op { - template <typename A, typename B> - constexpr static auto run(A a, B b) -> decltype(a != b) { - return a != b; - } -}; struct lesser_op { template <typename A, typename B> constexpr static auto run(A a, B b) -> decltype(a < b) { return a < b; } }; -struct lesser_equal_op { - template <typename A, typename B> - constexpr static auto run(A a, B b) -> decltype(a <= b) { - return a <= b; - } -}; -struct greater_op { - template <typename A, typename B> - constexpr static auto run(A a, B b) -> decltype(a > b) { - return a > b; - } -}; -struct greater_equal_op { - template <typename A, typename B> - constexpr static auto run(A a, B b) -> decltype(a >= b) { - return a >= b; - } -}; /* generic unary operations */ -struct not_op { - template <typename A> - constexpr static auto run(A a) -> decltype(!a) { - return !a; - } -}; -struct negation_op { - template <typename A> - constexpr static auto run(A a) -> decltype(-a) { - return -a; - } -}; struct greater_equal_zero_op { template <typename A> constexpr static auto run(A a) -> decltype(a >= 0) {
diff --git a/Eigen/src/SparseCore/CompressedStorage.h b/Eigen/src/SparseCore/CompressedStorage.h index 8f8a696..30bd8ad 100644 --- a/Eigen/src/SparseCore/CompressedStorage.h +++ b/Eigen/src/SparseCore/CompressedStorage.h
@@ -72,10 +72,9 @@ void resize(Index size, double reserveSizeFactor = 0) { if (m_allocatedSize < size) { // Avoid underflow on the std::min<Index> call by choosing the smaller index type. - using SmallerIndexType = - typename std::conditional<static_cast<size_t>((std::numeric_limits<Index>::max)()) < - static_cast<size_t>((std::numeric_limits<StorageIndex>::max)()), - Index, StorageIndex>::type; + using SmallerIndexType = std::conditional_t<static_cast<size_t>((std::numeric_limits<Index>::max)()) < + static_cast<size_t>((std::numeric_limits<StorageIndex>::max)()), + Index, StorageIndex>; Index realloc_size = (std::min<Index>)(NumTraits<SmallerIndexType>::highest(), size + Index(reserveSizeFactor * double(size))); if (realloc_size < size) internal::throw_std_bad_alloc();
diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h index acdaf93..514107e 100644 --- a/Eigen/src/SparseCore/SparseMatrixBase.h +++ b/Eigen/src/SparseCore/SparseMatrixBase.h
@@ -225,7 +225,7 @@ #ifndef EIGEN_NO_IO friend std::ostream& operator<<(std::ostream& s, const SparseMatrixBase& m) { using Nested = typename Derived::Nested; - using NestedCleaned = typename internal::remove_all<Nested>::type; + using NestedCleaned = internal::remove_all_t<Nested>; if (Flags & RowMajorBit) { Nested nm(m.derived());
diff --git a/Eigen/src/SparseCore/SparseSolverBase.h b/Eigen/src/SparseCore/SparseSolverBase.h index acf1564..a1ed4ba 100644 --- a/Eigen/src/SparseCore/SparseSolverBase.h +++ b/Eigen/src/SparseCore/SparseSolverBase.h
@@ -64,14 +64,17 @@ * */ template <typename Derived> -class SparseSolverBase : internal::noncopyable { +class SparseSolverBase { public: /** Default constructor */ SparseSolverBase() : m_isInitialized(false) {} - SparseSolverBase(SparseSolverBase&& other) : internal::noncopyable{}, m_isInitialized{other.m_isInitialized} {} + SparseSolverBase(const SparseSolverBase&) = delete; + SparseSolverBase& operator=(const SparseSolverBase&) = delete; - ~SparseSolverBase() {} + SparseSolverBase(SparseSolverBase&& other) : m_isInitialized{other.m_isInitialized} {} + + ~SparseSolverBase() = default; Derived& derived() { return *static_cast<Derived*>(this); } const Derived& derived() const { return *static_cast<const Derived*>(this); }
diff --git a/blas/GeneralRank1Update.h b/blas/GeneralRank1Update.h index e6c3cab..48cba97 100644 --- a/blas/GeneralRank1Update.h +++ b/blas/GeneralRank1Update.h
@@ -21,7 +21,7 @@ struct general_rank1_update<Scalar, Index, ColMajor, ConjLhs, ConjRhs> { static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha) { typedef Map<const Matrix<Scalar, Dynamic, 1> > OtherMap; - typedef typename conj_expr_if<ConjLhs, OtherMap>::type ConjRhsType; + typedef conj_expr_if<ConjLhs, OtherMap> ConjRhsType; conj_if<ConjRhs> cj; for (Index i = 0; i < cols; ++i)
diff --git a/blas/PackedSelfadjointProduct.h b/blas/PackedSelfadjointProduct.h index 5109960..6e8c70d 100644 --- a/blas/PackedSelfadjointProduct.h +++ b/blas/PackedSelfadjointProduct.h
@@ -24,7 +24,7 @@ typedef typename NumTraits<Scalar>::Real RealScalar; static void run(Index size, Scalar* mat, const Scalar* vec, RealScalar alpha) { typedef Map<const Matrix<Scalar, Dynamic, 1> > OtherMap; - typedef typename conj_expr_if<ConjLhs, OtherMap>::type ConjRhsType; + typedef conj_expr_if<ConjLhs, OtherMap> ConjRhsType; conj_if<ConjRhs> cj; for (Index i = 0; i < size; ++i) {
diff --git a/blas/PackedTriangularMatrixVector.h b/blas/PackedTriangularMatrixVector.h index 4e8e085..5b92670 100644 --- a/blas/PackedTriangularMatrixVector.h +++ b/blas/PackedTriangularMatrixVector.h
@@ -28,7 +28,7 @@ static void run(Index size, const LhsScalar* lhs, const RhsScalar* rhs, ResScalar* res, ResScalar alpha) { internal::conj_if<ConjRhs> cj; typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap; - typedef typename conj_expr_if<ConjLhs, LhsMap>::type ConjLhsType; + typedef conj_expr_if<ConjLhs, LhsMap> ConjLhsType; typedef Map<Matrix<ResScalar, Dynamic, 1> > ResMap; for (Index i = 0; i < size; ++i) { @@ -56,9 +56,9 @@ static void run(Index size, const LhsScalar* lhs, const RhsScalar* rhs, ResScalar* res, ResScalar alpha) { internal::conj_if<ConjRhs> cj; typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap; - typedef typename conj_expr_if<ConjLhs, LhsMap>::type ConjLhsType; + typedef conj_expr_if<ConjLhs, LhsMap> ConjLhsType; typedef Map<const Matrix<RhsScalar, Dynamic, 1> > RhsMap; - typedef typename conj_expr_if<ConjRhs, RhsMap>::type ConjRhsType; + typedef conj_expr_if<ConjRhs, RhsMap> ConjRhsType; for (Index i = 0; i < size; ++i) { Index s = !IsLower && (HasUnitDiag || HasZeroDiag) ? 1 : 0;
diff --git a/blas/PackedTriangularSolverVector.h b/blas/PackedTriangularSolverVector.h index 92964fb..76a828a 100644 --- a/blas/PackedTriangularSolverVector.h +++ b/blas/PackedTriangularSolverVector.h
@@ -23,7 +23,7 @@ static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs) { internal::conj_if<Conjugate> cj; typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap; - typedef typename conj_expr_if<Conjugate, LhsMap>::type ConjLhsType; + typedef conj_expr_if<Conjugate, LhsMap> ConjLhsType; lhs += IsLower ? 0 : (size * (size + 1) >> 1) - 1; for (Index pi = 0; pi < size; ++pi) { @@ -46,7 +46,7 @@ static void run(Index size, const LhsScalar* lhs, RhsScalar* rhs) { internal::conj_if<Conjugate> cj; typedef Map<const Matrix<LhsScalar, Dynamic, 1> > LhsMap; - typedef typename conj_expr_if<Conjugate, LhsMap>::type ConjLhsType; + typedef conj_expr_if<Conjugate, LhsMap> ConjLhsType; lhs += IsLower ? 0 : size * (size - 1) >> 1; for (Index pi = 0; pi < size; ++pi) {
diff --git a/test/array_cwise.cpp b/test/array_cwise.cpp index dd39cf1..2e74e2e 100644 --- a/test/array_cwise.cpp +++ b/test/array_cwise.cpp
@@ -1329,8 +1329,8 @@ template <size_t i = 0, size_t j = i + 1, bool Done = (i >= ScalarTupleSize - 1) || (j >= ScalarTupleSize)> static std::enable_if_t<!Done> run() { - using Type1 = typename std::tuple_element<i, ScalarTuple>::type; - using Type2 = typename std::tuple_element<j, ScalarTuple>::type; + using Type1 = std::tuple_element_t<i, ScalarTuple>; + using Type2 = std::tuple_element_t<j, ScalarTuple>; cast_test_impl<Type1, Type2, RowsAtCompileTime, ColsAtCompileTime>::run(); cast_test_impl<Type2, Type1, RowsAtCompileTime, ColsAtCompileTime>::run(); static constexpr size_t next_i = (j == ScalarTupleSize - 1) ? (i + 1) : (i + 0);
diff --git a/test/gpu_common.h b/test/gpu_common.h index 0e7c605..4e20850 100644 --- a/test/gpu_common.h +++ b/test/gpu_common.h
@@ -51,9 +51,9 @@ gpuDeviceSynchronize(); #ifdef EIGEN_USE_HIP - hipLaunchKernelGGL(HIP_KERNEL_NAME(run_on_gpu_meta_kernel<Kernel, typename std::decay<decltype(*d_in)>::type, - typename std::decay<decltype(*d_out)>::type>), - dim3(Grids), dim3(Blocks), 0, 0, ker, n, d_in, d_out); + hipLaunchKernelGGL( + HIP_KERNEL_NAME(run_on_gpu_meta_kernel<Kernel, std::decay_t<decltype(*d_in)>, std::decay_t<decltype(*d_out)>>), + dim3(Grids), dim3(Blocks), 0, 0, ker, n, d_in, d_out); #else // Various versions of clang-format incorrectly add spaces to the kernel launch brackets. // clang-format off
diff --git a/test/gpu_test_helper.h b/test/gpu_test_helper.h index 80960eb..15a05e6 100644 --- a/test/gpu_test_helper.h +++ b/test/gpu_test_helper.h
@@ -40,9 +40,6 @@ #undef EIGEN_USE_CUSTOM_TUPLE } // namespace test_detail -template <typename T> -using decay_t = typename std::decay<T>::type; - template <typename Func, typename... Args> using kernel_result_t = decltype(std::declval<Func>()(std::declval<Args>()...)); @@ -64,10 +61,10 @@ struct extract_output_indices_helper<N, Idx, std::index_sequence<OutputIndices...>, T1, Ts...> { using type = typename extract_output_indices_helper< N - 1, Idx + 1, - typename std::conditional< + std::conditional_t< // If is a non-const l-value reference, append index. std::is_lvalue_reference<T1>::value && !std::is_const<std::remove_reference_t<T1>>::value, - std::index_sequence<OutputIndices..., Idx>, std::index_sequence<OutputIndices...>>::type, + std::index_sequence<OutputIndices..., Idx>, std::index_sequence<OutputIndices...>>, Ts...>::type; }; @@ -89,7 +86,7 @@ // Converts void -> Void, T otherwise. template <typename T> - using ReturnType = typename std::conditional<std::is_same<T, void>::value, Void, T>::type; + using ReturnType = std::conditional_t<std::is_same<T, void>::value, Void, T>; // Non-void return value. template <typename Func, typename... Args> @@ -109,9 +106,8 @@ // Restores the original return type, Void -> void, T otherwise. template <typename T> - static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC - std::enable_if_t<!std::is_same<typename std::decay<T>::type, Void>::value, T> - restore(T&& val) { + static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC std::enable_if_t<!std::is_same<std::decay_t<T>, Void>::value, T> restore( + T&& val) { return val; } @@ -140,18 +136,18 @@ const uint8_t* read_end = buffer + capacity; read_ptr = Eigen::deserialize(read_ptr, read_end, input_size); // Create value-type instances to populate. - auto args = make_tuple(decay_t<Args>{}...); + auto args = make_tuple(std::decay_t<Args>{}...); EIGEN_UNUSED_VARIABLE(args); // Avoid NVCC compile warning. // NVCC 9.1 requires us to spell out the template parameters explicitly. - read_ptr = Eigen::deserialize(read_ptr, read_end, get<Indices, decay_t<Args>...>(args)...); + read_ptr = Eigen::deserialize(read_ptr, read_end, get<Indices, std::decay_t<Args>...>(args)...); // Call function, with void->Void conversion so we are guaranteed a complete // output type. - auto result = void_helper::call(kernel, get<Indices, decay_t<Args>...>(args)...); + auto result = void_helper::call(kernel, get<Indices, std::decay_t<Args>...>(args)...); // Determine required output size. size_t output_size = Eigen::serialize_size(capacity); - output_size += Eigen::serialize_size(get<OutputIndices, decay_t<Args>...>(args)...); + output_size += Eigen::serialize_size(get<OutputIndices, std::decay_t<Args>...>(args)...); output_size += Eigen::serialize_size(result); // Always serialize required buffer size. @@ -162,7 +158,7 @@ // Serialize outputs if they fit in the buffer. if (output_size <= capacity) { // Collect outputs and result. - write_ptr = Eigen::serialize(write_ptr, write_end, get<OutputIndices, decay_t<Args>...>(args)...); + write_ptr = Eigen::serialize(write_ptr, write_end, get<OutputIndices, std::decay_t<Args>...>(args)...); write_ptr = Eigen::serialize(write_ptr, write_end, result); } }
diff --git a/test/main.h b/test/main.h index b429572..1f68572 100644 --- a/test/main.h +++ b/test/main.h
@@ -52,10 +52,8 @@ #include <queue> #include <cassert> #include <list> -#if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) #include <random> #include <chrono> -#endif #if __cplusplus > 201703L // libstdc++ 9's <memory> indirectly uses max() via <bit>. // libstdc++ 10's <memory> indirectly uses max() via ranges headers.
diff --git a/test/meta.cpp b/test/meta.cpp index 7c09348..d79a01c 100644 --- a/test/meta.cpp +++ b/test/meta.cpp
@@ -111,25 +111,6 @@ VERIFY((internal::has_ReturnType<ScalarBinaryOpTraits<int, int>>::value)); VERIFY((!internal::has_ReturnType<MatrixXf>::value)); VERIFY((!internal::has_ReturnType<int>::value)); - - VERIFY(internal::meta_sqrt<1>::ret == 1); -#define VERIFY_META_SQRT(X) VERIFY(internal::meta_sqrt<X>::ret == int(std::sqrt(double(X)))) - VERIFY_META_SQRT(2); - VERIFY_META_SQRT(3); - VERIFY_META_SQRT(4); - VERIFY_META_SQRT(5); - VERIFY_META_SQRT(6); - VERIFY_META_SQRT(8); - VERIFY_META_SQRT(9); - VERIFY_META_SQRT(15); - VERIFY_META_SQRT(16); - VERIFY_META_SQRT(17); - VERIFY_META_SQRT(255); - VERIFY_META_SQRT(256); - VERIFY_META_SQRT(257); - VERIFY_META_SQRT(1023); - VERIFY_META_SQRT(1024); - VERIFY_META_SQRT(1025); } using Eigen::internal::apply_op_from_left;
diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 0091525..f36e6d5 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp
@@ -872,7 +872,7 @@ test::packet_helper<PacketTraits::HasNegate, Packet> h; data1[0] = Scalar{-0}; h.store(data2, internal::pnegate(h.load(data1))); - typedef typename internal::make_unsigned<typename internal::make_integer<Scalar>::type>::type Bits; + typedef std::make_unsigned_t<typename internal::make_integer<Scalar>::type> Bits; Bits bits = numext::bit_cast<Bits>(data2[0]); VERIFY_IS_EQUAL(bits, static_cast<Bits>(Bits(1) << (sizeof(Scalar) * CHAR_BIT - 1))); }
diff --git a/unsupported/Eigen/src/AutoDiff/CoherentPadOp.h b/unsupported/Eigen/src/AutoDiff/CoherentPadOp.h index 696ef5b..68f8b0a 100644 --- a/unsupported/Eigen/src/AutoDiff/CoherentPadOp.h +++ b/unsupported/Eigen/src/AutoDiff/CoherentPadOp.h
@@ -22,7 +22,7 @@ template <typename XprType, int SizeAtCompileTime_> struct traits<CoherentPadOp<XprType, SizeAtCompileTime_>> : public traits<XprType> { - typedef typename internal::remove_all<XprType>::type PlainXprType; + typedef internal::remove_all_t<XprType> PlainXprType; typedef typename internal::ref_selector<XprType>::type XprNested; typedef typename std::remove_reference_t<XprNested> XprNested_; enum : int {
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h index 4266495..ee77e88 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h
@@ -86,7 +86,7 @@ * facilitate future development of triangular matrix functions. */ template <typename MatrixType> -class MatrixPowerAtomic : internal::noncopyable { +class MatrixPowerAtomic { private: enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime }; typedef typename MatrixType::Scalar Scalar; @@ -107,6 +107,9 @@ static RealScalar computeSuperDiag(RealScalar, RealScalar, RealScalar p); public: + MatrixPowerAtomic(const MatrixPowerAtomic&) = delete; + MatrixPowerAtomic& operator=(const MatrixPowerAtomic&) = delete; + /** * \brief Constructor. * @@ -340,12 +343,15 @@ * Output: \verbinclude MatrixPower_optimal.out */ template <typename MatrixType> -class MatrixPower : internal::noncopyable { +class MatrixPower { private: typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; public: + MatrixPower(const MatrixPower&) = delete; + MatrixPower& operator=(const MatrixPower&) = delete; + /** * \brief Constructor. *