SOLA
Loading...
Searching...
No Matches
natter_check.h
1// Copyright The SOLA Contributors
2//
3// Licensed under the MIT License.
4// For details on the licensing terms, see the LICENSE file.
5// SPDX-License-Identifier: MIT
6
7#ifndef NATTER_NATTER_CHECK_H_
8#define NATTER_NATTER_CHECK_H_
9
10#include <stdexcept>
11
12// Checks if (req)uirement is true. Otherwise, throws exception with msg
13#define NATTER_CHECK(req, msg) \
14 if (!(req)) { \
15 throw std::runtime_error(msg); \
16 } \
17 static_assert(true)
18
19#endif // NATTER_NATTER_CHECK_H_