DUNE
Distributed and Unified Numerics Environment
Dune Core Modules (2.9.1)
dune
common
boundschecking.hh
Go to the documentation of this file.
1
// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3
#ifndef DUNE_BOUNDSCHECKING_HH
4
#define DUNE_BOUNDSCHECKING_HH
5
6
#include <
dune/common/exceptions.hh
>
7
19
#ifndef DUNE_ASSERT_BOUNDS
20
#if defined(DUNE_CHECK_BOUNDS) || defined(DOXYGEN)
21
30
#define DUNE_ASSERT_BOUNDS(cond) \
31
do { \
32
if (!(cond)) \
33
DUNE_THROW(Dune::RangeError, "Index out of bounds."
); \
34
} while (false)
35
36
#else
37
#define DUNE_ASSERT_BOUNDS(cond)
38
#endif
39
#endif
40
41
/* @} */
42
43
#endif
// DUNE_BOUNDSCHECKING_HH
exceptions.hh
A few common exception classes.
|
Legal Statements / Impressum
| Hosted by
TU Dresden
| generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)