From 6e97698161275db750868afb99f405cdb849f412 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 16 Jan 2017 16:13:37 +0100 Subject: [PATCH] Introduce a EIGEN_HAS_CXX14 macro --- Eigen/src/Core/util/Macros.h | 5 +++++ Eigen/src/Core/util/SymbolicIndex.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 14addd8fb..7462dc5cf 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -362,6 +362,11 @@ #define EIGEN_HAS_CXX11 0 #endif +#if EIGEN_MAX_CPP_VER>=14 && (defined(__cplusplus) && (__cplusplus > 201103L) || EIGEN_COMP_MSVC >= 1900) +#define EIGEN_HAS_CXX14 1 +#else +#define EIGEN_HAS_CXX14 0 +#endif // Do we support r-value references? #ifndef EIGEN_HAS_RVALUE_REFERENCES diff --git a/Eigen/src/Core/util/SymbolicIndex.h b/Eigen/src/Core/util/SymbolicIndex.h index 03086d6fa..6f603f301 100644 --- a/Eigen/src/Core/util/SymbolicIndex.h +++ b/Eigen/src/Core/util/SymbolicIndex.h @@ -76,7 +76,7 @@ public: template Index eval(const T& values) const { return derived().eval_impl(values); } -#if __cplusplus > 201103L +#if EIGEN_HAS_CXX14 template Index eval(Types&&... values) const { return derived().eval_impl(std::make_tuple(values...)); } #endif