From 150c12e138ab372d7f43ce19b260acd36ede9fc3 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 12 Nov 2015 18:11:56 -0800 Subject: Completed the IndexList rewrite --- .../Eigen/CXX11/src/Tensor/TensorIndexList.h | 50 ++++++++++++---------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h index 472fad0da..859c16ab0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h @@ -294,47 +294,57 @@ template constexpr Den } template -struct index_known_statically { - constexpr bool operator() (DenseIndex) const { +struct index_known_statically_impl { + static constexpr bool run(const DenseIndex) { return false; } }; template -struct index_known_statically > { - constexpr bool operator() (const DenseIndex i) const { +struct index_known_statically_impl > { + static constexpr bool run(const DenseIndex i) { return IndexList().value_known_statically(i); } }; template -struct index_known_statically > { - constexpr bool operator() (const DenseIndex i) const { +struct index_known_statically_impl > { + static constexpr bool run(const DenseIndex i) { return IndexList().value_known_statically(i); } }; template -struct all_indices_known_statically { - constexpr bool operator() () const { +static constexpr bool index_known_statically(const DenseIndex i) { + return index_known_statically_impl::run(i); +} + +template +struct all_indices_known_statically_impl { + static constexpr bool run() { return false; } }; template -struct all_indices_known_statically > { - constexpr bool operator() () const { +struct all_indices_known_statically_impl > { + static constexpr bool run() { return IndexList().all_values_known_statically(); } }; template -struct all_indices_known_statically > { - constexpr bool operator() () const { +struct all_indices_known_statically_impl > { + static constexpr bool run() { return IndexList().all_values_known_statically(); } }; +template +static constexpr bool all_indices_known_statically() { + return all_indices_known_statically_impl::run(); +} + template struct indices_statically_known_to_increase_impl { static constexpr bool run() { @@ -491,18 +501,14 @@ namespace internal { // No C++11 support template -struct index_known_statically { - EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool operator() (DenseIndex) const{ - return false; - } -}; +static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool index_known_statically(DenseIndex) { + return false; +} template -struct all_indices_known_statically { - EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool operator() () const { - return false; - } -}; +static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool all_indices_known_statically() { + return false; +} template static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool indices_statically_known_to_increase() { -- cgit v1.2.3