Explorar o código

storage: assert on requirements (see #458)

Michele Caini %!s(int64=6) %!d(string=hai) anos
pai
achega
6006917622
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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>>;