diff --git a/TODO b/TODO index 321ed2e67..9ecf0d8a0 100644 --- a/TODO +++ b/TODO @@ -17,7 +17,7 @@ WIP: * entity-only and exclude-only views * custom allocators all over * remove storage::patch -* use ENTT_NOEXCEPT_IF as appropriate (ie make compressed_pair conditionally noexcept) +* consider removing ENTT_NOEXCEPT, use ENTT_NOEXCEPT_IF (or noexcept(...)) as appropriate in any case (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 f3aa88d78..caa287178 100644 --- a/src/entt/config/config.h +++ b/src/entt/config/config.h @@ -4,19 +4,22 @@ #include "version.h" #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) #endif +#ifndef ENTT_NOEXCEPT +# define ENTT_NOEXCEPT noexcept +# define ENTT_NOEXCEPT_IF(expr) noexcept(expr) +# else +# define ENTT_NOEXCEPT_IF(...) +#endif + #ifdef ENTT_USE_ATOMIC # include # define ENTT_MAYBE_ATOMIC(Type) std::atomic