stl: iterator_traits
This commit is contained in:
@@ -97,8 +97,8 @@ struct radix_sort {
|
||||
if(first < last) {
|
||||
constexpr auto passes = N / Bit;
|
||||
|
||||
using value_type = std::iterator_traits<It>::value_type;
|
||||
using difference_type = std::iterator_traits<It>::difference_type;
|
||||
using value_type = stl::iterator_traits<It>::value_type;
|
||||
using difference_type = stl::iterator_traits<It>::difference_type;
|
||||
stl::vector<value_type> aux(static_cast<std::size_t>(stl::distance(first, last)));
|
||||
|
||||
auto part = [getter = std::move(getter)](auto from, auto to, auto out, auto start) {
|
||||
|
||||
@@ -123,7 +123,7 @@ private:
|
||||
template<stl::input_or_output_iterator It, stl::sentinel_for<It> Sentinel = It>
|
||||
struct iterable_adaptor final {
|
||||
/*! @brief Value type. */
|
||||
using value_type = std::iterator_traits<It>::value_type;
|
||||
using value_type = stl::iterator_traits<It>::value_type;
|
||||
/*! @brief Iterator type. */
|
||||
using iterator = It;
|
||||
/*! @brief Sentinel type. */
|
||||
|
||||
@@ -666,7 +666,7 @@ template<typename>
|
||||
struct has_iterator_category: std::false_type {};
|
||||
|
||||
template<typename Type>
|
||||
requires requires { typename std::iterator_traits<Type>::iterator_category; }
|
||||
requires requires { typename stl::iterator_traits<Type>::iterator_category; }
|
||||
struct has_iterator_category<Type>: std::true_type {};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
@@ -25,7 +25,7 @@ class handle_storage_iterator final {
|
||||
using entity_type = underlying_type::entity_type;
|
||||
|
||||
public:
|
||||
using value_type = std::iterator_traits<It>::value_type;
|
||||
using value_type = stl::iterator_traits<It>::value_type;
|
||||
using pointer = input_iterator_pointer<value_type>;
|
||||
using reference = value_type;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
|
||||
@@ -598,7 +598,7 @@ public:
|
||||
* @param from An iterator to the first element of the range of elements.
|
||||
*/
|
||||
template<typename Type, typename EIt, typename CIt>
|
||||
requires std::same_as<typename std::iterator_traits<CIt>::value_type, Type>
|
||||
requires std::same_as<typename stl::iterator_traits<CIt>::value_type, Type>
|
||||
void insert(EIt first, EIt last, CIt from) {
|
||||
ENTT_ASSERT(std::all_of(first, last, [this](const auto entt) { return valid(entt); }), "Invalid entity");
|
||||
assure<Type>().insert(first, last, from);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace internal {
|
||||
template<typename Set>
|
||||
class runtime_view_iterator final {
|
||||
using iterator_type = Set::iterator;
|
||||
using iterator_traits = std::iterator_traits<iterator_type>;
|
||||
using iterator_traits = stl::iterator_traits<iterator_type>;
|
||||
|
||||
[[nodiscard]] bool valid() const {
|
||||
return (!tombstone_check || *it != tombstone)
|
||||
|
||||
@@ -34,7 +34,7 @@ class storage_iterator final {
|
||||
using container_type = std::remove_const_t<Container>;
|
||||
using alloc_traits = std::allocator_traits<typename container_type::allocator_type>;
|
||||
|
||||
using iterator_traits = std::iterator_traits<std::conditional_t<
|
||||
using iterator_traits = stl::iterator_traits<std::conditional_t<
|
||||
std::is_const_v<Container>,
|
||||
typename alloc_traits::template rebind_traits<typename std::pointer_traits<typename container_type::value_type>::element_type>::const_pointer,
|
||||
typename alloc_traits::template rebind_traits<typename std::pointer_traits<typename container_type::value_type>::element_type>::pointer>>;
|
||||
@@ -725,7 +725,7 @@ public:
|
||||
* @return Iterator pointing to the first element inserted, if any.
|
||||
*/
|
||||
template<stl::input_iterator It>
|
||||
requires std::same_as<typename std::iterator_traits<It>::value_type, value_type>
|
||||
requires std::same_as<typename stl::iterator_traits<It>::value_type, value_type>
|
||||
iterator insert(stl::input_iterator auto first, stl::input_iterator auto last, It from) {
|
||||
for(; first != last; ++first, ++from) {
|
||||
emplace_element(*first, true, *from);
|
||||
|
||||
@@ -41,7 +41,7 @@ const Type *view_placeholder() {
|
||||
}
|
||||
|
||||
template<typename It>
|
||||
[[nodiscard]] bool fully_initialized(It first, const It last, const std::remove_pointer_t<typename std::iterator_traits<It>::value_type> *placeholder) noexcept {
|
||||
[[nodiscard]] bool fully_initialized(It first, const It last, const std::remove_pointer_t<typename stl::iterator_traits<It>::value_type> *placeholder) noexcept {
|
||||
for(; (first != last) && *first != placeholder; ++first) {}
|
||||
return first == last;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class view_iterator final {
|
||||
friend struct extended_view_iterator;
|
||||
|
||||
using iterator_type = Type::const_iterator;
|
||||
using iterator_traits = std::iterator_traits<iterator_type>;
|
||||
using iterator_traits = stl::iterator_traits<iterator_type>;
|
||||
|
||||
[[nodiscard]] bool valid(const iterator_traits::value_type entt) const noexcept {
|
||||
return (!Checked || (entt != tombstone))
|
||||
|
||||
@@ -11,6 +11,7 @@ using std::bidirectional_iterator_tag;
|
||||
using std::distance;
|
||||
using std::forward_iterator_tag;
|
||||
using std::input_iterator_tag;
|
||||
using std::iterator_traits;
|
||||
using std::make_reverse_iterator;
|
||||
using std::random_access_iterator_tag;
|
||||
using std::reverse_iterator;
|
||||
|
||||
Reference in New Issue
Block a user