From: kainan.wang Date: Tue, 2 Apr 2013 21:42:59 +0000 (+0000) Subject: Add generic declaration ExcIndexRangeType and AssertGlobalIndexRange in exception.h X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cee794ce582c2919e844f6bcb86b5b851b7298c;p=dealii-svn.git 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 --- 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,