mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-18 22:23:14 +02: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:
@ -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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user