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:
Martin Leitner-Ankerl 2023-03-26 15:39:53 +02:00
parent 81f67977f5
commit fffc86f49f

View file

@ -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);