mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-21 20:28:59 +02:00
util: Make Assert work with any value
This commit is contained in:
@@ -54,6 +54,6 @@ T get_pure_r_value(T&& val)
|
||||
}
|
||||
|
||||
/** Identity function. Abort if the value compares equal to zero */
|
||||
#define Assert(val) [&]() -> decltype(get_pure_r_value(val))& { auto& check = (val); assert(#val && check); return check; }()
|
||||
#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); }()
|
||||
|
||||
#endif // BITCOIN_UTIL_CHECK_H
|
||||
|
||||
Reference in New Issue
Block a user