diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-10-11 21:04:50 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-11-24 09:46:49 +0100 |
commit | fa861569dcfff9e72686dc5f30b1faa645b4d54e (patch) | |
tree | c2685b3bc66841e4a69a792a578a842b187ffd2b /src/util | |
parent | cb89e18845852c005ba8ab94acc6544d7c876a42 (diff) |
util: Allow Assert(...) to be used in all contexts
Fixes the compile error when used inside operator[]:
./chain.h:404:23: error: C++11 only allows consecutive left square brackets when introducing an attribute
return (*this)[Assert(pindex)->nHeight] == pindex;
^
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 9edf394492..aca0c3d9f9 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 std::forward<decltype(get_pure_r_value(val))>(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 |