Added a new EIGEN_HAS_INDEXED_VIEW define that set to 0 for older compilers that are known to fail to compile the indexed views (I used the define from the indexed_views.cpp test).

Only include the indexed view methods when the compiler supports the code.
This makes it possible to use Eigen again in complex code bases such as TensorFlow and older compilers such as gcc 4.8
This commit is contained in:
Benoit Steiner
2017-02-10 13:08:49 -08:00
parent a1ff24f96a
commit 8b3cc54c42
3 changed files with 10 additions and 5 deletions

View File

@@ -349,6 +349,12 @@
# define __has_feature(x) 0
#endif
#if !( EIGEN_COMP_CLANG && ((EIGEN_COMP_CLANG<309) || defined(__apple_build_version__)) || EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC<49)
#define EIGEN_HAS_INDEXED_VIEW 1
#else
#define EIGEN_HAS_INDEXED_VIEW 0
#endif
// Upperbound on the C++ version to use.
// Expected values are 03, 11, 14, 17, etc.
// By default, let's use an arbitrarily large C++ version.