dune-common 2.8.0
Loading...
Searching...
No Matches
assertandreturn.hh
Go to the documentation of this file.
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