Browse Source

config: add ENTT_ENTT_CONSTEXPR to use in combination with ENTT_TRY and the like (waiting for C++20)

Michele Caini 3 years ago
parent
commit
759d9a642f
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/entt/config/config.h

+ 2 - 0
src/entt/config/config.h

@@ -4,10 +4,12 @@
 #include "version.h"
 
 #if defined(__cpp_exceptions) && !defined(ENTT_NOEXCEPTION)
+#    define ENTT_CONSTEXPR
 #    define ENTT_THROW throw
 #    define ENTT_TRY try
 #    define ENTT_CATCH catch(...)
 #else
+#    define ENTT_CONSTEXPR constexpr // use only with throwing functions (waiting for C++20)
 #    define ENTT_THROW
 #    define ENTT_TRY if(true)
 #    define ENTT_CATCH if(false)