5 #ifndef BITCOIN_UTIL_CHECK_H
6 #define BITCOIN_UTIL_CHECK_H
8 #if defined(HAVE_CONFIG_H)
18 using std::runtime_error::runtime_error;
32 #define CHECK_NONFATAL(condition) \
35 throw NonFatalCheckError( \
36 strprintf("%s:%d (%s)\n" \
37 "Internal bug detected: '%s'\n" \
38 "You may report this issue here: %s\n", \
39 __FILE__, __LINE__, __func__, \
41 PACKAGE_BUGREPORT)); \
46 #error "Cannot compile without assertions!"
53 return std::forward<T>(val);
57 #define Assert(val) [&]() -> decltype(get_pure_r_value(val)) { auto&& check = (val); assert(#val && check); return std::forward<decltype(get_pure_r_value(val))>(check); }()
T get_pure_r_value(T &&val)
Helper for Assert().