From b7c6fbaf704157fd580b0337d7f27e82e432e222 Mon Sep 17 00:00:00 2001 From: ubpa Date: Mon, 22 Feb 2021 01:14:17 -0800 Subject: [PATCH] fix bugs on MacOS GCC 10.2 --- include/UECS/AccessTypeID.h | 7 ++++++- include/UECS/EntityQuery.h | 7 ++++++- include/UECS/SystemTraits.h | 1 + include/UECS/details/AccessTypeID.inl | 13 ------------- include/UECS/details/EntityQuery.inl | 12 ------------ include/UECS/details/TypeIDSet.inl | 14 ++++++-------- 6 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 include/UECS/details/AccessTypeID.inl delete mode 100644 include/UECS/details/EntityQuery.inl diff --git a/include/UECS/AccessTypeID.h b/include/UECS/AccessTypeID.h index 31e7084..905adbc 100644 --- a/include/UECS/AccessTypeID.h +++ b/include/UECS/AccessTypeID.h @@ -31,4 +31,9 @@ namespace Ubpa::UECS { using AccessTypeIDSet = std::set>; } -#include "details/AccessTypeID.inl" +template<> +struct std::hash { + constexpr std::size_t operator()(const Ubpa::UECS::AccessTypeID& id) const noexcept { + return id.GetValue(); + } +}; diff --git a/include/UECS/EntityQuery.h b/include/UECS/EntityQuery.h index 6a6586c..6b729b1 100644 --- a/include/UECS/EntityQuery.h +++ b/include/UECS/EntityQuery.h @@ -18,4 +18,9 @@ namespace Ubpa::UECS { }; } -#include "details/EntityQuery.inl" +template<> +struct std::hash { + std::size_t operator()(const Ubpa::UECS::EntityQuery& query) const noexcept { + return query.GetValue(); + } +}; diff --git a/include/UECS/SystemTraits.h b/include/UECS/SystemTraits.h index d6b6491..37733e4 100644 --- a/include/UECS/SystemTraits.h +++ b/include/UECS/SystemTraits.h @@ -4,6 +4,7 @@ #include #include #include +#include namespace Ubpa::UECS { class World; diff --git a/include/UECS/details/AccessTypeID.inl b/include/UECS/details/AccessTypeID.inl deleted file mode 100644 index 1170867..0000000 --- a/include/UECS/details/AccessTypeID.inl +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace std { - template - struct hash; -} - -template<> -struct std::hash { - constexpr std::size_t operator()(const Ubpa::UECS::AccessTypeID& id) const noexcept { - return id.GetValue(); - } -}; diff --git a/include/UECS/details/EntityQuery.inl b/include/UECS/details/EntityQuery.inl deleted file mode 100644 index d0835df..0000000 --- a/include/UECS/details/EntityQuery.inl +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -namespace std { - template - struct hash; - template<> - struct hash { - std::size_t operator()(const Ubpa::UECS::EntityQuery& query) const noexcept { - return query.GetValue(); - } - }; -} diff --git a/include/UECS/details/TypeIDSet.inl b/include/UECS/details/TypeIDSet.inl index c0e57c1..c0923e5 100644 --- a/include/UECS/details/TypeIDSet.inl +++ b/include/UECS/details/TypeIDSet.inl @@ -88,11 +88,9 @@ namespace Ubpa::UECS { } } -namespace std { - template<> - struct hash { - std::size_t operator()(const Ubpa::UECS::TypeIDSet& types) const noexcept { - return types.GetValue(); - } - }; -} +template<> +struct std::hash { + std::size_t operator()(const Ubpa::UECS::TypeIDSet& types) const noexcept { + return types.GetValue(); + } +};