*: minor changes

This commit is contained in:
Michele Caini
2022-08-22 16:34:58 +02:00
parent 7205fb63fa
commit e2e8a575c6
3 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ namespace entt {
*/
template<typename Type>
[[nodiscard]] constexpr auto to_address(Type &&ptr) noexcept {
if constexpr(std::is_pointer_v<std::remove_cv_t<std::remove_reference_t<Type>>>) {
if constexpr(std::is_pointer_v<std::decay_t<Type>>) {
return ptr;
} else {
return to_address(std::forward<Type>(ptr).operator->());

View File

@@ -41,7 +41,7 @@ struct page_size<Type, std::enable_if_t<std::is_convertible_v<decltype(Type::pag
*/
template<typename Type, typename = void>
struct component_traits {
static_assert(std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, Type>, "Unsupported type");
static_assert(std::is_same_v<std::decay_t<Type>, Type>, "Unsupported type");
/*! @brief Component type. */
using type = Type;

View File

@@ -103,7 +103,7 @@ private:
* @param reg A registry that contains the given entity and its components.
* @param entt Entity from which to get the component.
*/
template<auto Member, typename Registry = std::remove_cv_t<std::remove_reference_t<nth_argument_t<0u, Member>>>>
template<auto Member, typename Registry = std::decay_t<nth_argument_t<0u, Member>>>
void invoke(Registry &reg, const typename Registry::entity_type entt) {
static_assert(std::is_member_function_pointer_v<decltype(Member)>, "Invalid pointer to non-static member function");
delegate<void(Registry &, const typename Registry::entity_type)> func;