diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-07-11 15:06:51 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-07-11 15:02:07 +0200 |
commit | fa5363538125d996ae5cede55f7f05e88701ace2 (patch) | |
tree | 06fa703f68df37e0ae4697b6c4bcd631791471c7 /src/util | |
parent | 5f96bce9b7f38c687817d58e8b54a5b7ebfe91b3 (diff) |
util: Make Assert work with any value
Diffstat (limited to 'src/util')
-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 3d534fd33e..9edf394492 100644 --- a/src/util/check.h +++ b/src/util/check.h @@ -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 |