component: automatic traits deduction

This commit is contained in:
Michele Caini
2022-02-11 10:35:43 +01:00
parent ed34a3f5d4
commit ed11bda9fd
11 changed files with 140 additions and 85 deletions

View File

@@ -13,16 +13,14 @@ struct position {
};
struct velocity: position {};
struct stable_position: position {};
struct stable_position: position {
static constexpr auto in_place_delete = true;
};
template<auto>
struct comp { int x; };
template<>
struct entt::component_traits<stable_position>: basic_component_traits {
static constexpr auto in_place_delete = true;
};
struct timer final {
timer()
: start{std::chrono::system_clock::now()} {}