mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
util: Make Assume() usable as unary expression
This commit is contained in:
@@ -69,7 +69,7 @@ T get_pure_r_value(T&& val)
|
||||
#ifdef ABORT_ON_FAILED_ASSUME
|
||||
#define Assume(val) Assert(val)
|
||||
#else
|
||||
#define Assume(val) ((void)(val))
|
||||
#define Assume(val) ([&]() -> decltype(get_pure_r_value(val)) { auto&& check = (val); return std::forward<decltype(get_pure_r_value(val))>(check); }())
|
||||
#endif
|
||||
|
||||
#endif // BITCOIN_UTIL_CHECK_H
|
||||
|
||||
Reference in New Issue
Block a user