00001 #ifndef DUNE_BOUNDSCHECKING_HH
00002 #define DUNE_BOUNDSCHECKING_HH
00003
00004 #include <dune/common/exceptions.hh>
00005
00017 #ifndef DUNE_ASSERT_BOUNDS
00018 #if defined(DUNE_CHECK_BOUNDS) || defined(DOXYGEN)
00019
00028 #define DUNE_ASSERT_BOUNDS(cond) \
00029 do { \
00030 if (!(cond)) \
00031 DUNE_THROW(Dune::RangeError, "Index out of bounds."); \
00032 } while (false)
00033
00034 #else
00035 #define DUNE_ASSERT_BOUNDS(cond)
00036 #endif
00037 #endif
00038
00039
00040
00041 #endif // DUNE_BOUNDSCHECKING_HH