aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-05-20 15:01:27 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-05-20 15:01:27 +0200
commitabd1c1af7a568b067ca8cec8b8345a7a6f9d2c28 (patch)
tree7ef2c5a1b5e57ffcb28e5fca38e7d54f1f1f16af
parent1395056fc0c077b0a1e9b1854c6f18d6bbb9ee61 (diff)
Make EIGEN_HAS_STD_RESULT_OF user configurable
-rw-r--r--Eigen/src/Core/util/Macros.h4
-rw-r--r--Eigen/src/Core/util/Meta.h2
-rw-r--r--test/mixingtypes.cpp2
3 files changed, 6 insertions, 2 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 3fcef82b6..fe383ee9a 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -372,8 +372,12 @@
#endif
// Does the compiler support result_of?
+#ifndef EIGEN_HAS_STD_RESULT_OF
#if EIGEN_MAX_CPP_VER>=11 && ((__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L)))
#define EIGEN_HAS_STD_RESULT_OF 1
+#else
+#define EIGEN_HAS_STD_RESULT_OF 0
+#endif
#endif
// Does the compiler support variadic templates?
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index 24e8a6d8a..1212f0cd3 100644
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -254,7 +254,7 @@ protected:
* upcoming next STL generation (using a templated result member).
* If none of these members is provided, then the type of the first argument is returned. FIXME, that behavior is a pretty bad hack.
*/
-#ifdef EIGEN_HAS_STD_RESULT_OF
+#if EIGEN_HAS_STD_RESULT_OF
template<typename T> struct result_of {
typedef typename std::result_of<T>::type type1;
typedef typename remove_all<type1>::type type;
diff --git a/test/mixingtypes.cpp b/test/mixingtypes.cpp
index 3d0875481..dbcf468ea 100644
--- a/test/mixingtypes.cpp
+++ b/test/mixingtypes.cpp
@@ -57,7 +57,7 @@ template<int SizeAtCompileType> void mixingtypes(int size = SizeAtCompileType)
mf+mf;
VERIFY_RAISES_ASSERT(mf+md);
-#ifndef EIGEN_HAS_STD_RESULT_OF
+#if !EIGEN_HAS_STD_RESULT_OF
// this one does not even compile with C++11
VERIFY_RAISES_ASSERT(mf+mcf);
#endif