From: Daniel Arndt Date: Fri, 2 Feb 2018 09:06:08 +0000 (+0100) Subject: Use the type of the largest value in AssertIndexRange X-Git-Tag: v9.0.0-rc1~479^2~10 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5aff8d5e5545a42a06f9656f1c1c35a9c1155376;p=dealii.git Use the type of the largest value in AssertIndexRange --- diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index b5c9d3e030..b8ca87b1a9 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -1213,6 +1213,17 @@ namespace StandardExceptions #define AssertVectorVectorDimension(vec,dim1,dim2) AssertDimension((vec).size(), (dim1)) \ for (unsigned int i=0;i struct argument_type; + template struct argument_type + { + typedef U type; + }; +} /** * An assertion that tests that a given index is within the half-open @@ -1223,8 +1234,12 @@ namespace StandardExceptions * @ingroup Exceptions * @author Guido Kanschat 2007 */ -#define AssertIndexRange(index,range) Assert((index) < (range), \ - dealii::ExcIndexRange((index),0,(range))) +#define AssertIndexRange(index,range) \ + Assert((index) < (range), \ + dealii::ExcIndexRangeType< \ + typename ::dealii::internal::argument_type< \ + void(typename std::common_type::type)>::type>((index),0,(range))) /** * An assertion that checks whether a number is finite or not. We explicitly