Skip to content

Commit

Permalink
type_traits: rollback recent changes to decouple checks again
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Dec 19, 2024
1 parent 6601ebe commit 3ed8049
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/entt/core/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,17 +675,22 @@ inline constexpr bool is_complete_v = is_complete<Type>::value;
template<typename Type, typename = void>
struct is_iterator: std::false_type {};

/*! @copydoc is_iterator */
/*! @cond TURN_OFF_DOXYGEN */
namespace internal {

template<typename, typename = void>
struct has_iterator_category: std::false_type {};

template<typename Type>
struct is_iterator<const Type>: is_iterator<Type> {};
struct has_iterator_category<Type, std::void_t<typename std::iterator_traits<Type>::iterator_category>>: std::true_type {};

/*! @copydoc is_iterator */
template<>
struct is_iterator<void *>: std::false_type {};
} // namespace internal
/*! @endcond */

/*! @copydoc is_iterator */
template<typename Type>
struct is_iterator<Type, std::void_t<typename std::iterator_traits<Type>::iterator_category>>: std::true_type {};
struct is_iterator<Type, std::enable_if_t<!std::is_void_v<std::remove_cv_t<std::remove_pointer_t<Type>>>>>
: internal::has_iterator_category<Type> {};

/**
* @brief Helper variable template.
Expand Down

0 comments on commit 3ed8049

Please sign in to comment.