]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use common type in AssertIndexRange for the comparison 7019/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 2 Aug 2018 09:04:43 +0000 (11:04 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 2 Aug 2018 09:06:46 +0000 (11:06 +0200)
include/deal.II/base/exceptions.h

index 6ff4068d00c62b693802d984544a6a50a84c6830..9f01ac2012a9ebad32b12e03e4fee965c778f184 100644 (file)
@@ -1402,11 +1402,16 @@ namespace internal
  * fails.
  *
  * @ingroup Exceptions
- * @author Guido Kanschat 2007
+ * @author Guido Kanschat, Daniel Arndt, 2007, 2018
  */
 #define AssertIndexRange(index, range)                                         \
   Assert(                                                                      \
-    (index) < (range),                                                         \
+    static_cast<typename ::dealii::internal::argument_type<void(               \
+        typename std::common_type<decltype(index), decltype(range)>::type)>::  \
+                  type>(index) <                                               \
+      static_cast<typename ::dealii::internal::argument_type<void(             \
+        typename std::common_type<decltype(index), decltype(range)>::type)>::  \
+                    type>(range),                                              \
     dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( \
       typename std::common_type<decltype(index), decltype(range)>::type)>::    \
                                 type>((index), 0, (range)))

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.