SOLA
Loading...
Searching...
No Matches
sola_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 SOLA_SOLA_CHECK_H_
8#define SOLA_SOLA_CHECK_H_
9
10#include <stdexcept>
11
12// Checks if (req)uirement is true. Otherwise, throws exception with msg
13#define SOLA_CHECK(req, msg) \
14 if (!(req)) { \
15 throw std::runtime_error(msg); \
16 }
17
18#endif // SOLA_SOLA_CHECK_H_