diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-02-28 16:38:19 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-03-04 12:03:50 +0100 |
commit | fa4cebadcffd9112da4b13c7cc7ccf21e2bee887 (patch) | |
tree | 934dc4c244fd2d7747feb2b751ebdb1f52c52968 /src/util/check.h | |
parent | d099894ec124598b37bd4a0a41b2c93e0034108f (diff) |
util: Make Assume() usable as unary expression
Diffstat (limited to 'src/util/check.h')
-rw-r--r-- | src/util/check.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/check.h b/src/util/check.h index bc62da3440..e60088a2c6 100644 --- a/src/util/check.h +++ b/src/util/check.h @@ -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 |