From fffc86f49f4eeb811b8438bc1b7f8d9e05882c6f Mon Sep 17 00:00:00 2001 From: Martin Leitner-Ankerl Date: Sun, 26 Mar 2023 15:39:53 +0200 Subject: 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 --- src/validation.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 #include #include +#include #include #include @@ -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); +static_assert(std::is_nothrow_move_constructible_v); +static_assert(std::is_nothrow_destructible_v); + /** Initializes the script-execution cache */ [[nodiscard]] bool InitScriptExecutionCache(size_t max_size_bytes); -- cgit v1.2.3