Sfoglia il codice sorgente

storage: assert on requirements (see #458)

Michele Caini 6 anni fa
parent
commit
6006917622
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      src/entt/entity/storage.hpp

+ 3 - 0
src/entt/entity/storage.hpp

@@ -47,6 +47,9 @@ namespace entt {
  */
 template<typename Entity, typename Type, typename = std::void_t<>>
 class storage: public sparse_set<Entity> {
+    static_assert(std::is_move_constructible_v<Type>);
+    static_assert(std::is_move_assignable_v<Type>);
+
     using underlying_type = sparse_set<Entity>;
     using traits_type = entt_traits<std::underlying_type_t<Entity>>;