group: make older compilers happy too

This commit is contained in:
Michele Caini
2024-04-09 15:35:37 +02:00
parent 4c98e3aa1e
commit 6ca01d2faf
2 changed files with 17 additions and 7 deletions

View File

@@ -312,8 +312,13 @@ public:
/*! @brief Group handler type. */
using handler = internal::group_handler<common_type, 0u, sizeof...(Get), sizeof...(Exclude)>;
/*! @brief Group opaque marker. */
static constexpr id_type group_id = type_hash<basic_group<owned_t<>, get_t<std::remove_const_t<Get>...>, exclude_t<std::remove_const_t<Exclude>...>>>::value();
/**
* @brief Group opaque identifier.
* @return Group opaque identifier.
*/
static id_type group_id() noexcept {
return type_hash<basic_group<owned_t<>, get_t<std::remove_const_t<Get>...>, exclude_t<std::remove_const_t<Exclude>...>>>::value();
}
/*! @brief Default constructor to use to create empty, invalid groups. */
basic_group() noexcept
@@ -722,8 +727,13 @@ public:
/*! @brief Group handler type. */
using handler = internal::group_handler<common_type, sizeof...(Owned), sizeof...(Get), sizeof...(Exclude)>;
/*! @brief Group opaque marker. */
static constexpr id_type group_id = type_hash<basic_group<owned_t<std::remove_const_t<Owned>...>, get_t<std::remove_const_t<Get>...>, exclude_t<std::remove_const_t<Exclude>...>>>::value();
/**
* @brief Group opaque identifier.
* @return Group opaque identifier.
*/
static id_type group_id() noexcept {
return type_hash<basic_group<owned_t<std::remove_const_t<Owned>...>, get_t<std::remove_const_t<Get>...>, exclude_t<std::remove_const_t<Exclude>...>>>::value();
}
/*! @brief Default constructor to use to create empty, invalid groups. */
basic_group() noexcept

View File

@@ -1070,7 +1070,7 @@ public:
using group_type = basic_group<owned_t<storage_for_type<Owned>...>, get_t<storage_for_type<Get>...>, exclude_t<storage_for_type<Exclude>...>>;
using handler_type = typename group_type::handler;
if(auto it = groups.find(group_type::group_id); it != groups.cend()) {
if(auto it = groups.find(group_type::group_id()); it != groups.cend()) {
return {*std::static_pointer_cast<handler_type>(it->second)};
}
@@ -1084,7 +1084,7 @@ public:
ENTT_ASSERT(std::all_of(groups.cbegin(), groups.cend(), [&elem](const auto &data) { return data.second->owned(elem, sizeof...(Owned)) == 0u; }), "Conflicting groups");
}
groups.emplace(group_type::group_id, handler);
groups.emplace(group_type::group_id(), handler);
return {*handler};
}
@@ -1095,7 +1095,7 @@ public:
using group_type = basic_group<owned_t<storage_for_type<const Owned>...>, get_t<storage_for_type<const Get>...>, exclude_t<storage_for_type<const Exclude>...>>;
using handler_type = typename group_type::handler;
if(auto it = groups.find(group_type::group_id); it != groups.cend()) {
if(auto it = groups.find(group_type::group_id()); it != groups.cend()) {
return {*std::static_pointer_cast<handler_type>(it->second)};
}