#pragma once #include #include #include #include // AKA the Fuckit macro #define $F(FMT, ...) fmt::format(FMT, ##__VA_ARGS__) namespace dbc { using std::string; using CheckError = std::runtime_error; using SentinelError = std::runtime_error; using PreCondError = std::runtime_error; using PostCondError = std::runtime_error; void log(const string &message, const std::source_location location = std::source_location::current()); [[noreturn]] void sentinel(const string &message, const std::source_location location = std::source_location::current()); void pre(const string &message, bool test, const std::source_location location = std::source_location::current()); void pre(const string &message, std::function tester, const std::source_location location = std::source_location::current()); void post(const string &message, bool test, const std::source_location location = std::source_location::current()); void post(const string &message, std::function tester, const std::source_location location = std::source_location::current()); void check(bool test, const string &message, const std::source_location location = std::source_location::current()); }