Przeglądaj źródła

stl: std::distance

skypjack 3 dni temu
rodzic
commit
fc9eb2a9f2

+ 1 - 1
src/entt/container/dense_map.hpp

@@ -915,7 +915,7 @@ public:
      * @return The number of elements in the given bucket.
      * @return The number of elements in the given bucket.
      */
      */
     [[nodiscard]] size_type bucket_size(const size_type index) const {
     [[nodiscard]] size_type bucket_size(const size_type index) const {
-        return static_cast<size_type>(std::distance(begin(index), end(index)));
+        return static_cast<size_type>(stl::distance(begin(index), end(index)));
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/entt/container/dense_set.hpp

@@ -791,7 +791,7 @@ public:
      * @return The number of elements in the given bucket.
      * @return The number of elements in the given bucket.
      */
      */
     [[nodiscard]] size_type bucket_size(const size_type index) const {
     [[nodiscard]] size_type bucket_size(const size_type index) const {
-        return static_cast<size_type>(std::distance(begin(index), end(index)));
+        return static_cast<size_type>(stl::distance(begin(index), end(index)));
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/entt/core/algorithm.hpp

@@ -99,7 +99,7 @@ struct radix_sort {
 
 
             using value_type = std::iterator_traits<It>::value_type;
             using value_type = std::iterator_traits<It>::value_type;
             using difference_type = std::iterator_traits<It>::difference_type;
             using difference_type = std::iterator_traits<It>::difference_type;
-            stl::vector<value_type> aux(static_cast<std::size_t>(std::distance(first, last)));
+            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) {
             auto part = [getter = std::move(getter)](auto from, auto to, auto out, auto start) {
                 constexpr auto mask = (1 << Bit) - 1;
                 constexpr auto mask = (1 << Bit) - 1;

+ 1 - 1
src/entt/entity/snapshot.hpp

@@ -138,7 +138,7 @@ public:
         static_assert(!std::is_same_v<Type, entity_type>, "Entity types not supported");
         static_assert(!std::is_same_v<Type, entity_type>, "Entity types not supported");
 
 
         if(const auto *storage = reg->template storage<Type>(id); storage && !storage->empty()) {
         if(const auto *storage = reg->template storage<Type>(id); storage && !storage->empty()) {
-            archive(static_cast<traits_type::entity_type>(std::distance(first, last)));
+            archive(static_cast<traits_type::entity_type>(stl::distance(first, last)));
 
 
             for(; first != last; ++first) {
             for(; first != last; ++first) {
                 if(const auto entt = *first; storage->contains(entt)) {
                 if(const auto entt = *first; storage->contains(entt)) {

+ 1 - 1
src/entt/entity/sparse_set.hpp

@@ -873,7 +873,7 @@ public:
                     ++first;
                     ++first;
                 }
                 }
 
 
-                count += static_cast<size_type>(std::distance(it, first));
+                count += static_cast<size_type>(stl::distance(it, first));
                 erase(it, first);
                 erase(it, first);
             }
             }
         } else {
         } else {

+ 3 - 1
src/entt/stl/iterator.hpp

@@ -10,9 +10,11 @@ namespace entt::stl {
 using std::bidirectional_iterator_tag;
 using std::bidirectional_iterator_tag;
 using std::forward_iterator_tag;
 using std::forward_iterator_tag;
 using std::input_iterator_tag;
 using std::input_iterator_tag;
-using std::make_reverse_iterator;
 using std::random_access_iterator_tag;
 using std::random_access_iterator_tag;
 
 
+using std::distance;
+using std::make_reverse_iterator;
+
 #ifndef ENTT_FORCE_STL
 #ifndef ENTT_FORCE_STL
 #    if __has_include(<version>)
 #    if __has_include(<version>)
 #        include <version>
 #        include <version>