Skip to content

Commit

Permalink
*: fix C++20 global module fragment inclusion (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonutVikingChap authored and skypjack committed Aug 18, 2023
1 parent 90dcd26 commit 12b6ee0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/entt/core/type_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ template<typename Type>
}

template<typename Type, auto = stripped_type_name<Type>().find_first_of('.')>
[[nodiscard]] static constexpr std::string_view type_name(int) noexcept {
[[nodiscard]] constexpr std::string_view type_name(int) noexcept {
constexpr auto value = stripped_type_name<Type>();
return value;
}

template<typename Type>
[[nodiscard]] static std::string_view type_name(char) noexcept {
[[nodiscard]] std::string_view type_name(char) noexcept {
static const auto value = stripped_type_name<Type>();
return value;
}

template<typename Type, auto = stripped_type_name<Type>().find_first_of('.')>
[[nodiscard]] static constexpr id_type type_hash(int) noexcept {
[[nodiscard]] constexpr id_type type_hash(int) noexcept {
constexpr auto stripped = stripped_type_name<Type>();
constexpr auto value = hashed_string::value(stripped.data(), stripped.size());
return value;
}

template<typename Type>
[[nodiscard]] static id_type type_hash(char) noexcept {
[[nodiscard]] id_type type_hash(char) noexcept {
static const auto value = [](const auto stripped) {
return hashed_string::value(stripped.data(), stripped.size());
}(stripped_type_name<Type>());
Expand Down
2 changes: 1 addition & 1 deletion src/entt/entity/entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace internal {

// waiting for C++20 (and std::popcount)
template<typename Type>
static constexpr int popcount(Type value) noexcept {
constexpr int popcount(Type value) noexcept {
return value ? (int(value & 1) + popcount(value >> 1)) : 0;
}

Expand Down

0 comments on commit 12b6ee0

Please sign in to comment.