diff options
author | Martin Leitner-Ankerl <martin.ankerl@gmail.com> | 2023-03-26 15:39:53 +0200 |
---|---|---|
committer | Martin Leitner-Ankerl <martin.ankerl@gmail.com> | 2023-03-26 15:49:52 +0200 |
commit | fffc86f49f4eeb811b8438bc1b7f8d9e05882c6f (patch) | |
tree | a22c87d32684bc4b25cd1edcace1af5bf070c67d /src | |
parent | 81f67977f543faca2dcc35846f73e2917375ae79 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/validation.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h index aba863db09..b6d1995c5b 100644 --- a/src/validation.h +++ b/src/validation.h @@ -42,6 +42,7 @@ #include <stdint.h> #include <string> #include <thread> +#include <type_traits> #include <utility> #include <vector> @@ -331,6 +332,11 @@ public: 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 */ [[nodiscard]] bool InitScriptExecutionCache(size_t max_size_bytes); |