mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
test: CScriptCheck is used a lot in std::vector, make sure that's efficient
Adds a few static_asserts so CScriptCheck stays is_nothrow_move_assignable, is_nothrow_move_constructible, and is_nothrow_destructible
This commit is contained in:
parent
81f67977f5
commit
fffc86f49f
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -331,6 +332,11 @@ public:
|
||||||
ScriptError GetScriptError() const { return error; }
|
ScriptError GetScriptError() const { return error; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// CScriptCheck is used a lot in std::vector, make sure that's efficient
|
||||||
|
static_assert(std::is_nothrow_move_assignable_v<CScriptCheck>);
|
||||||
|
static_assert(std::is_nothrow_move_constructible_v<CScriptCheck>);
|
||||||
|
static_assert(std::is_nothrow_destructible_v<CScriptCheck>);
|
||||||
|
|
||||||
/** Initializes the script-execution cache */
|
/** Initializes the script-execution cache */
|
||||||
[[nodiscard]] bool InitScriptExecutionCache(size_t max_size_bytes);
|
[[nodiscard]] bool InitScriptExecutionCache(size_t max_size_bytes);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue