aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-12 16:41:14 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-11-12 16:41:14 -0800
commite9ecfad7967fd5285846647372897ecdc125f976 (patch)
treebb81fde1cd6211895fa65c14b5c3ba658fa237d2 /unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h
parent7a1316fcc564b709b361592c6897591d9747c401 (diff)
Started to make the IndexList code compile by more compilers
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h
index dcd2464f1..69d21d3c1 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h
@@ -336,26 +336,32 @@ struct all_indices_known_statically<const IndexList<FirstType, OtherTypes...> >
};
template <typename T>
-struct indices_statically_known_to_increase {
- constexpr bool operator() () const {
+struct indices_statically_known_to_increase_impl {
+ static constexpr bool run() {
return false;
}
};
template <typename FirstType, typename... OtherTypes>
-struct indices_statically_known_to_increase<IndexList<FirstType, OtherTypes...> > {
- constexpr bool operator() () const {
- return IndexList<FirstType, OtherTypes...>().values_statically_known_to_increase();
+ struct indices_statically_known_to_increase_impl<IndexList<FirstType, OtherTypes...> > {
+ static constexpr bool run() {
+ return Eigen::IndexList<FirstType, OtherTypes...>().values_statically_known_to_increase();
}
};
template <typename FirstType, typename... OtherTypes>
-struct indices_statically_known_to_increase<const IndexList<FirstType, OtherTypes...> > {
- constexpr bool operator() () const {
- return IndexList<FirstType, OtherTypes...>().values_statically_known_to_increase();
+ struct indices_statically_known_to_increase_impl<const IndexList<FirstType, OtherTypes...> > {
+ static constexpr bool run() {
+ return Eigen::IndexList<FirstType, OtherTypes...>().values_statically_known_to_increase();
}
};
+template <typename T>
+static constexpr bool indices_statically_known_to_increase() {
+ return indices_statically_known_to_increase_impl<T>::run();
+}
+
+
template <typename Tx>
struct index_statically_eq {
constexpr bool operator() (DenseIndex, DenseIndex) const {
@@ -473,11 +479,9 @@ struct all_indices_known_statically {
};
template <typename T>
-struct indices_statically_known_to_increase {
- EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool operator() () const {
- return false;
- }
-};
+static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool indices_statically_known_to_increase() {
+ return false;
+}
template <typename T>
struct index_statically_eq {