aboutsummaryrefslogtreecommitdiff
path: root/src/util/check.h
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-10-11 21:04:50 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-11-24 09:46:49 +0100
commitfa861569dcfff9e72686dc5f30b1faa645b4d54e (patch)
treec2685b3bc66841e4a69a792a578a842b187ffd2b /src/util/check.h
parentcb89e18845852c005ba8ab94acc6544d7c876a42 (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/check.h')
-rw-r--r--src/util/check.h2
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