Dune Core Modules (2.8.0)

assertandreturn.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_COMMON_ASSERTANDRETURN_HH
4#define DUNE_COMMON_ASSERTANDRETURN_HH
5
6#include <cassert>
7
9
17#ifdef NDEBUG
18 #define DUNE_ASSERT_AND_RETURN(C,X) X
19#else
20 #define DUNE_ASSERT_AND_RETURN(C,X) (!(C) ? throw [&](){assert(!#C);return 0;}() : 0), X
21#endif
22
23
24
25#endif // DUNE_COMMON_ASSERTANDRETURN_HH
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)