Sleipnir C++ API
Loading...
Searching...
No Matches
Assert.hpp
Go to the documentation of this file.
1// Copyright (c) Sleipnir contributors
2
3#pragma once
4
5#ifdef JORMUNGANDR
6#include <format>
7#include <stdexcept>
11#define Assert(condition) \
12 do { \
13 if (!(condition)) { \
14 throw std::invalid_argument( \
15 std::format("{}:{}: {}: Assertion `{}' failed.", __FILE__, __LINE__, \
16 __func__, #condition)); \
17 } \
18 } while (0);
19#else
20#include <cassert>
24#define Assert(condition) assert(condition)
25#endif