From f6aaafd60fe4e7b79750dee5c623ccc67aa2183f Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 22 Mar 2022 12:43:47 +0100 Subject: [PATCH] config: add ENTT_NOEXCEPT_IF (for future uses) --- TODO | 2 +- src/entt/config/config.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 92154ae23..abb97c3da 100644 --- a/TODO +++ b/TODO @@ -5,13 +5,13 @@ WIP: * get rid of storage_traits class template * uses-allocator construction: any (with allocator support), cache, poly, ... -* add an ENTT_NOEXCEPT with args and use it to make ie compressed_pair conditionally noexcept * process scheduler: reviews, use free lists internally * runtime events (emitter) * iterator based try_emplace vs try_insert for perf reasons * dedicated entity storage, in-place O(1) release/destroy for non-orphaned entities, out-of-sync model * entity-only and exclude-only views * custom allocators all over +* use ENTT_NOEXCEPT_IF as appropriate (ie make compressed_pair conditionally noexcept) WIP: * add user data to type_info diff --git a/src/entt/config/config.h b/src/entt/config/config.h index 82a370649..7b5982f23 100644 --- a/src/entt/config/config.h +++ b/src/entt/config/config.h @@ -5,11 +5,13 @@ #if defined(__cpp_exceptions) && !defined(ENTT_NOEXCEPTION) # define ENTT_NOEXCEPT noexcept +# define ENTT_NOEXCEPT_IF(expr) noexcept(expr) # define ENTT_THROW throw # define ENTT_TRY try # define ENTT_CATCH catch(...) #else # define ENTT_NOEXCEPT +# define ENTT_NOEXCEPT_IF(...) # define ENTT_THROW # define ENTT_TRY if(true) # define ENTT_CATCH if(false)