Introduce a EIGEN_HAS_CXX14 macro

This commit is contained in:
Gael Guennebaud 2017-01-16 16:13:37 +01:00
parent 752bd92ba5
commit 6e97698161
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -76,7 +76,7 @@ public:
template<typename T>
Index eval(const T& values) const { return derived().eval_impl(values); }
#if __cplusplus > 201103L
#if EIGEN_HAS_CXX14
template<typename... Types>
Index eval(Types&&... values) const { return derived().eval_impl(std::make_tuple(values...)); }
#endif