/usr/include/dune/common/boundschecking.hh is in libdune-common-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #ifndef DUNE_BOUNDSCHECKING_HH
#define DUNE_BOUNDSCHECKING_HH
#include <dune/common/exceptions.hh>
/**
* \file
* \brief Macro for wrapping boundary checks
*/
/**
* @addtogroup Common
*
* @{
*/
#ifndef DUNE_ASSERT_BOUNDS
#if defined(DUNE_CHECK_BOUNDS) || defined(DOXYGEN)
/**
* \brief If `DUNE_CHECK_BOUNDS` is defined: check if condition
* \a cond holds; otherwise, do nothing.
*
* Meant to be used for conditions that assure writes and reads
* do not occur outside of memory limits or pre-defined patterns
* and related conditions.
*/
#define DUNE_ASSERT_BOUNDS(cond) \
do { \
if (!(cond)) \
DUNE_THROW(Dune::RangeError, "Index out of bounds."); \
} while (false)
#else
#define DUNE_ASSERT_BOUNDS(cond)
#endif
#endif
/* @} */
#endif // DUNE_BOUNDSCHECKING_HH
|