review: as_group
This commit is contained in:
@@ -77,17 +77,13 @@ struct as_group {
|
||||
|
||||
/**
|
||||
* @brief Conversion function from a registry to a group.
|
||||
*
|
||||
* @note
|
||||
* Unfortunately, only full owning groups are supported because of an issue
|
||||
* with msvc that doesn't manage to correctly deduce types.
|
||||
*
|
||||
* @tparam Get Types of components observed by the group.
|
||||
* @tparam Owned Types of components owned by the group.
|
||||
* @return A newly created group.
|
||||
*/
|
||||
template<typename... Owned>
|
||||
operator entt::basic_group<Entity, get_t<>, Owned...>() const {
|
||||
return reg.template group<Owned...>();
|
||||
template<typename Get, typename... Owned>
|
||||
operator entt::basic_group<Entity, Get, Owned...>() const {
|
||||
return reg.template group<Owned...>(Get{});
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -20,6 +20,10 @@ TEST(Helper, AsGroup) {
|
||||
([](entt::group<entt::get_t<>, double, float>) {})(entt::as_group{registry});
|
||||
([](entt::group<entt::get_t<>, const double, float>) {})(entt::as_group{registry});
|
||||
([](entt::group<entt::get_t<>, const double, const float>) {})(entt::as_group{cregistry});
|
||||
|
||||
([](entt::group<entt::get_t<int>, char>) {})(entt::as_group{registry});
|
||||
([](entt::group<entt::get_t<const int>, char>) {})(entt::as_group{registry});
|
||||
([](entt::group<entt::get_t<const int>, const char>) {})(entt::as_group{cregistry});
|
||||
}
|
||||
|
||||
TEST(Helper, Dependency) {
|
||||
|
||||
Reference in New Issue
Block a user