From 2a091519970f24ab6d770fbf5244bf7a0dde78d1 Mon Sep 17 00:00:00 2001 From: Kainan Wang Date: Tue, 2 Apr 2013 21:42:59 +0000 Subject: [PATCH] Add generic declaration ExcIndexRangeType and AssertGlobalIndexRange in exception.h git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29154 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/exceptions.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deal.II/include/deal.II/base/exceptions.h b/deal.II/include/deal.II/base/exceptions.h index b7dba69576..82bdec6f35 100644 --- a/deal.II/include/deal.II/base/exceptions.h +++ b/deal.II/include/deal.II/base/exceptions.h @@ -734,6 +734,16 @@ namespace StandardExceptions << "Index " << arg1 << " is not in [" << arg2 << "," << arg3 << "["); + /** + * This generic exception will allow(enforce) the user to specify + * the type of indices which adds type safety to the program. + */ + template + DeclException3 (ExcIndexRangeType, + T,T,T, + << "Index " << arg1 << " is not in [" << arg2 << "," + << arg3 << "["); + /** * A number is too small. */ @@ -896,6 +906,9 @@ namespace StandardExceptions #define AssertIndexRange(index,range) Assert((index) < (range), \ ExcIndexRange((index),0,(range))) +#define AssertGlobalIndexRange(index,range) Assert((index) < (range), \ + ExcIndexRange((index),0,(range))) + /* * Unfortunately, the following must be repeated for each library, -- 2.39.5