1
0
Эх сурвалжийг харах

iterable_adaptor: constrain iterator types

skypjack 1 сар өмнө
parent
commit
7d50da0463
2 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 0 1
      TODO
  2. 2 1
      src/entt/core/iterator.hpp

+ 0 - 1
TODO

@@ -38,4 +38,3 @@ TODO:
 * hashed_string consteval-ness on construction to further reduce risks
 * review sentinels (std::default_sentinel and the like)
 * review non-const to const iterator conversions
-* meta_base, then iterator.hpp

+ 2 - 1
src/entt/core/iterator.hpp

@@ -1,6 +1,7 @@
 #ifndef ENTT_CORE_ITERATOR_HPP
 #define ENTT_CORE_ITERATOR_HPP
 
+#include <concepts>
 #include <iterator>
 #include <memory>
 #include <type_traits>
@@ -122,7 +123,7 @@ private:
  * @tparam It Type of iterator.
  * @tparam Sentinel Type of sentinel.
  */
-template<typename It, typename Sentinel = It>
+template<std::input_or_output_iterator It, std::sentinel_for<It> Sentinel = It>
 struct iterable_adaptor final {
     /*! @brief Value type. */
     using value_type = std::iterator_traits<It>::value_type;