Loading...
Searching...
No Matches
boundschecking.hh
Go to the documentation of this file.
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#ifndef DUNE_BOUNDSCHECKING_HH
#define DUNE_BOUNDSCHECKING_HH
#include <dune/common/exceptions.hh>
#ifndef DUNE_ASSERT_BOUNDS
#if defined(DUNE_CHECK_BOUNDS) || defined(DOXYGEN)
#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
exceptions.hh
A few common exception classes.