storage: assert on requirements (see #458)

This commit is contained in:
Michele Caini
2020-04-09 19:42:45 +02:00
parent 4ffcf6bf3b
commit 6006917622

View File

@@ -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>>;