DUNE PDELab (2.8)

stdthread.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4#ifndef DUNE_COMMON_STDTHREAD_HH
5#define DUNE_COMMON_STDTHREAD_HH
6
7namespace Dune
8{
9
10 // used internally by assertCallOnce for the actual check
11 void doAssertCallOnce(const char *file, int line, const char *function);
12
15
33 inline void assertCallOnce(const char *file = nullptr, int line = -1,
34 const char *function = nullptr)
35 {
36 // make sure to call this only the first time this function is invoked
37 [[maybe_unused]] static const bool works
38 = (doAssertCallOnce(file, line, function), true);
39 }
40
43
47#define DUNE_ASSERT_CALL_ONCE() \
48 ::Dune::assertCallOnce(__FILE__, __LINE__, __func__)
49
50} // namespace Dune
51
52#endif // DUNE_COMMON_STDTHREAD_HH
constexpr GeometryType line
GeometryType representing a line.
Definition: type.hh:510
Dune namespace.
Definition: alignedallocator.hh:11
void assertCallOnce(const char *file=nullptr, int line=-1, const char *function=nullptr)
Make sure call_once() works and provide a helpful error message otherwise.
Definition: stdthread.hh:33
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Aug 31, 22:30, 2024)