소스 검색

config: add ENTT_NOEXCEPT_IF (for future uses)

Michele Caini 4 년 전
부모
커밋
f6aaafd60f
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      TODO
  2. 2 0
      src/entt/config/config.h

+ 1 - 1
TODO

@@ -5,13 +5,13 @@
 WIP:
 WIP:
 * get rid of storage_traits class template
 * get rid of storage_traits class template
 * uses-allocator construction: any (with allocator support), cache, poly, ...
 * 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
 * process scheduler: reviews, use free lists internally
 * runtime events (emitter)
 * runtime events (emitter)
 * iterator based try_emplace vs try_insert for perf reasons
 * 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
 * dedicated entity storage, in-place O(1) release/destroy for non-orphaned entities, out-of-sync model
 * entity-only and exclude-only views
 * entity-only and exclude-only views
 * custom allocators all over
 * custom allocators all over
+* use ENTT_NOEXCEPT_IF as appropriate (ie make compressed_pair conditionally noexcept)
 
 
 WIP:
 WIP:
 * add user data to type_info
 * add user data to type_info

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

@@ -5,11 +5,13 @@
 
 
 #if defined(__cpp_exceptions) && !defined(ENTT_NOEXCEPTION)
 #if defined(__cpp_exceptions) && !defined(ENTT_NOEXCEPTION)
 #    define ENTT_NOEXCEPT noexcept
 #    define ENTT_NOEXCEPT noexcept
+#    define ENTT_NOEXCEPT_IF(expr) noexcept(expr)
 #    define ENTT_THROW throw
 #    define ENTT_THROW throw
 #    define ENTT_TRY try
 #    define ENTT_TRY try
 #    define ENTT_CATCH catch(...)
 #    define ENTT_CATCH catch(...)
 #else
 #else
 #    define ENTT_NOEXCEPT
 #    define ENTT_NOEXCEPT
+#    define ENTT_NOEXCEPT_IF(...)
 #    define ENTT_THROW
 #    define ENTT_THROW
 #    define ENTT_TRY if(true)
 #    define ENTT_TRY if(true)
 #    define ENTT_CATCH if(false)
 #    define ENTT_CATCH if(false)