aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/util
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-20 17:08:43 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-20 17:08:43 +0200
commita0166ab6514d47bad8db2502c460953af811ea38 (patch)
tree0b185072308adb3183fc60631e823ec4dbbadfc2 /unsupported/Eigen/CXX11/src/util
parentc50250cb241abb3ea90bac86bc1c27dfadd0862c (diff)
Workaround for spurious "array subscript is above array bounds" warnings with g++4.x
Diffstat (limited to 'unsupported/Eigen/CXX11/src/util')
-rw-r--r--unsupported/Eigen/CXX11/src/util/EmulateArray.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/unsupported/Eigen/CXX11/src/util/EmulateArray.h b/unsupported/Eigen/CXX11/src/util/EmulateArray.h
index d5c000e08..39c255791 100644
--- a/unsupported/Eigen/CXX11/src/util/EmulateArray.h
+++ b/unsupported/Eigen/CXX11/src/util/EmulateArray.h
@@ -21,9 +21,9 @@ namespace Eigen {
template <typename T, size_t n> class array {
public:
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE T& operator[] (size_t index) { return values[index]; }
+ EIGEN_STRONG_INLINE T& operator[] (size_t index) { eigen_internal_assert(index < size()); return values[index]; }
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE const T& operator[] (size_t index) const { return values[index]; }
+ EIGEN_STRONG_INLINE const T& operator[] (size_t index) const { eigen_internal_assert(index < size()); return values[index]; }
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE T& at(size_t index) { eigen_assert(index < size()); return values[index]; }