dune-common  2.8.0
boundschecking.hh
Go to the documentation of this file.
1 #ifndef DUNE_BOUNDSCHECKING_HH
2 #define DUNE_BOUNDSCHECKING_HH
3 
5 
17 #ifndef DUNE_ASSERT_BOUNDS
18 #if defined(DUNE_CHECK_BOUNDS) || defined(DOXYGEN)
19 
28 #define DUNE_ASSERT_BOUNDS(cond) \
29  do { \
30  if (!(cond)) \
31  DUNE_THROW(Dune::RangeError, "Index out of bounds."); \
32  } while (false)
33 
34 #else
35 #define DUNE_ASSERT_BOUNDS(cond)
36 #endif
37 #endif
38 
39 /* @} */
40 
41 #endif // DUNE_BOUNDSCHECKING_HH
A few common exception classes.