aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-05-20 14:54:20 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-05-20 14:54:20 +0200
commit48bf5ec2164974c88935148aa1dff09a41d532b2 (patch)
tree5dd972cc4785fc10508af318412db185a2b133d7
parentf43ae88892be4dddf895043d2c51ef354a404a00 (diff)
Make EIGEN_HAS_RVALUE_REFERENCES user configurable
-rw-r--r--Eigen/src/Core/Array.h2
-rw-r--r--Eigen/src/Core/DenseStorage.h6
-rw-r--r--Eigen/src/Core/Matrix.h2
-rw-r--r--Eigen/src/Core/PlainObjectBase.h2
-rw-r--r--Eigen/src/Core/util/Macros.h6
-rw-r--r--test/rvalue_types.cpp2
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h2
7 files changed, 13 insertions, 9 deletions
diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h
index f296dd495..c0af4aa9d 100644
--- a/Eigen/src/Core/Array.h
+++ b/Eigen/src/Core/Array.h
@@ -147,7 +147,7 @@ class Array
}
#endif
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
Array(Array&& other)
: Base(std::move(other))
diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h
index cf55b6b35..4c0afdc7a 100644
--- a/Eigen/src/Core/DenseStorage.h
+++ b/Eigen/src/Core/DenseStorage.h
@@ -362,7 +362,7 @@ template<typename T, int _Options> class DenseStorage<T, Dynamic, Dynamic, Dynam
}
return *this;
}
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
DenseStorage(DenseStorage&& other)
: m_data(std::move(other.m_data))
@@ -441,7 +441,7 @@ template<typename T, int _Rows, int _Options> class DenseStorage<T, Dynamic, _Ro
}
return *this;
}
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
DenseStorage(DenseStorage&& other)
: m_data(std::move(other.m_data))
@@ -514,7 +514,7 @@ template<typename T, int _Cols, int _Options> class DenseStorage<T, Dynamic, Dyn
}
return *this;
}
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
DenseStorage(DenseStorage&& other)
: m_data(std::move(other.m_data))
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h
index f053f759d..ac40c82f0 100644
--- a/Eigen/src/Core/Matrix.h
+++ b/Eigen/src/Core/Matrix.h
@@ -268,7 +268,7 @@ class Matrix
: Base(internal::constructor_without_unaligned_array_assert())
{ Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
Matrix(Matrix&& other)
: Base(std::move(other))
diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h
index d929cc4aa..f2e14400f 100644
--- a/Eigen/src/Core/PlainObjectBase.h
+++ b/Eigen/src/Core/PlainObjectBase.h
@@ -471,7 +471,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
}
#endif
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
PlainObjectBase(PlainObjectBase&& other)
: m_storage( std::move(other.m_storage) )
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 4fe0dde8f..7fb194a40 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -348,11 +348,15 @@
#endif
// Do we support r-value references?
+#ifndef EIGEN_HAS_RVALUE_REFERENCES
#if EIGEN_MAX_CPP_VER>=11 && \
(__has_feature(cxx_rvalue_references) || \
(defined(__cplusplus) && __cplusplus >= 201103L) || \
(EIGEN_COMP_MSVC >= 1600))
- #define EIGEN_HAS_RVALUE_REFERENCES
+ #define EIGEN_HAS_RVALUE_REFERENCES 1
+#else
+ #define EIGEN_HAS_RVALUE_REFERENCES 0
+#endif
#endif
// Does the compiler support C99?
diff --git a/test/rvalue_types.cpp b/test/rvalue_types.cpp
index b4eda140c..a263d737f 100644
--- a/test/rvalue_types.cpp
+++ b/test/rvalue_types.cpp
@@ -11,7 +11,7 @@
#include <Eigen/Core>
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
template <typename MatrixType>
void rvalue_copyassign(const MatrixType& m)
{
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
index 4ff965f61..4573a0926 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
@@ -309,7 +309,7 @@ class TensorFixedSize : public TensorBase<TensorFixedSize<Scalar_, Dimensions_,
{
}
-#ifdef EIGEN_HAS_RVALUE_REFERENCES
+#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorFixedSize(Self&& other)
: m_storage(other.m_storage)
{