Просмотр исходного кода

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

Michele Caini 4 лет назад
Родитель
Сommit
759d9a642f
1 измененных файлов с 2 добавлено и 0 удалено
  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)