aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/IndexedViewHelper.h
diff options
context:
space:
mode:
authorGravatar Steve Bronder <stevo15025@gmail.com>2021-03-04 18:58:08 +0000
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2021-03-04 18:58:08 +0000
commit6cbb3038ac48cb5fe17eba4dfbf26e3e798041f1 (patch)
treef6b55d8169c36a10b4cfb0c35c2e067a774d252d /Eigen/src/Core/util/IndexedViewHelper.h
parent5bfc67f9e7efde8c8ffae9b56f63186d682b9d44 (diff)
Adds EIGEN_CONSTEXPR and EIGEN_NOEXCEPT to rows(), cols(), innerStride(), outerStride(), and size()
Diffstat (limited to 'Eigen/src/Core/util/IndexedViewHelper.h')
-rw-r--r--Eigen/src/Core/util/IndexedViewHelper.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Eigen/src/Core/util/IndexedViewHelper.h b/Eigen/src/Core/util/IndexedViewHelper.h
index 1cda85060..f85de305f 100644
--- a/Eigen/src/Core/util/IndexedViewHelper.h
+++ b/Eigen/src/Core/util/IndexedViewHelper.h
@@ -78,7 +78,7 @@ template<typename T, typename EnableIf = void> struct get_compile_time_incr {
// Analogue of std::get<0>(x), but tailored for our needs.
template<typename T>
-Index first(const T& x) { return x.first(); }
+EIGEN_CONSTEXPR Index first(const T& x) EIGEN_NOEXCEPT { return x.first(); }
// IndexedViewCompatibleType/makeIndexedViewCompatible turn an arbitrary object of type T into something usable by MatrixSlice
// The generic implementation is a no-op
@@ -100,8 +100,8 @@ struct SingleRange {
};
SingleRange(Index val) : m_value(val) {}
Index operator[](Index) const { return m_value; }
- Index size() const { return 1; }
- Index first() const { return m_value; }
+ static EIGEN_CONSTEXPR Index size() EIGEN_NOEXCEPT { return 1; }
+ Index first() const EIGEN_NOEXCEPT { return m_value; }
Index m_value;
};
@@ -141,9 +141,9 @@ template<int XprSize>
struct AllRange {
enum { SizeAtCompileTime = XprSize };
AllRange(Index size = XprSize) : m_size(size) {}
- Index operator[](Index i) const { return i; }
- Index size() const { return m_size.value(); }
- Index first() const { return 0; }
+ EIGEN_CONSTEXPR Index operator[](Index i) const EIGEN_NOEXCEPT { return i; }
+ EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_size.value(); }
+ EIGEN_CONSTEXPR Index first() const EIGEN_NOEXCEPT { return 0; }
variable_if_dynamic<Index,XprSize> m_size;
};