]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use DEAL_II_CXX23_ASSERT in the Tensor class. 16583/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 1 Feb 2024 18:43:03 +0000 (11:43 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 1 Feb 2024 18:43:03 +0000 (11:43 -0700)
include/deal.II/base/tensor.h

index 3f01782dc815060ee7d7854304b5e38a29134ebe..2d5e78e495673428e9c777617f5655a9edd588cc 100644 (file)
@@ -1537,6 +1537,7 @@ constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE
   Assert(dim != 0,
          ExcMessage("Cannot access an object of type Tensor<rank_,0,Number>"));
   AssertIndexRange(i, dim);
+  DEAL_II_CXX23_ASSUME(i < dim);
 
   return values[i];
 }
@@ -1550,6 +1551,7 @@ constexpr DEAL_II_ALWAYS_INLINE
   Assert(dim != 0,
          ExcMessage("Cannot access an object of type Tensor<rank_,0,Number>"));
   AssertIndexRange(i, dim);
+  DEAL_II_CXX23_ASSUME(i < dim);
 
   return values[i];
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.