From: Simon Sticko Date: Wed, 3 Jun 2020 14:41:04 +0000 (+0200) Subject: Add assert on range of incoming index in Tensor::operator[] const. X-Git-Tag: v9.3.0-rc1~1492^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dcd92e15d7f7f5b67f66c19d1eef39cdf35625b;p=dealii.git Add assert on range of incoming index in Tensor::operator[] const. --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index a18260c869..69b5ce9035 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1253,6 +1253,8 @@ constexpr DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV const typename Tensor::value_type & Tensor::operator[](const unsigned int i) const { + AssertIndexRange(i, dim); + return values[i]; }