Program Listing for File CheckException.hpp
↰ Return to documentation for file (libs/common/include/CheckException.hpp)
#pragma once
#include <functional>
#include <stdexcept>
#include <string>
#include "DllHelper.hpp"
CACAO_API inline void CheckException(bool cond, std::string msg, std::function<void()> unwindFn = []() {}) {
if(!cond) {
unwindFn();
throw std::runtime_error(msg);
}
}