mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
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; ^
This commit is contained in:
parent
cb89e18845
commit
fa861569dc
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue