Lines Matching full:it

28 template <class It>
31 It it_;
38 typedef typename std::iterator_traits<It>::difference_type difference_type;
39 typedef It pointer;
40 typedef typename std::iterator_traits<It>::reference reference;
42 TEST_CONSTEXPR explicit cpp17_output_iterator(It it) : it_(std::move(it)) {}
58 friend TEST_CONSTEXPR It base(const cpp17_output_iterator& i) { return i.it_; }
64 template <class It>
65 cpp17_output_iterator(It) -> cpp17_output_iterator<It>;
74 template <class It, class ItTraits = It>
78 It it_;
86 typedef It pointer;
89 TEST_CONSTEXPR explicit cpp17_input_iterator(It it) : it_(it) {}
108 friend TEST_CONSTEXPR It base(const cpp17_input_iterator& i) { return i.it_; }
114 template <class It>
115 cpp17_input_iterator(It) -> cpp17_input_iterator<It>;
122 template <class It>
125 It it_;
131 typedef typename std::iterator_traits<It>::value_type value_type;
132 typedef typename std::iterator_traits<It>::difference_type difference_type;
133 typedef It pointer;
134 typedef typename std::iterator_traits<It>::reference reference;
137 TEST_CONSTEXPR explicit forward_iterator(It it) : it_(it) {}
156 friend TEST_CONSTEXPR It base(const forward_iterator& i) { return i.it_; }
162 template <class It>
163 forward_iterator(It) -> forward_iterator<It>;
166 template <class It>
169 It it_;
175 typedef typename std::iterator_traits<It>::value_type value_type;
176 typedef typename std::iterator_traits<It>::difference_type difference_type;
177 typedef It pointer;
178 typedef typename std::iterator_traits<It>::reference reference;
181 TEST_CONSTEXPR explicit bidirectional_iterator(It it) : it_(it) {}
202 friend TEST_CONSTEXPR It base(const bidirectional_iterator& i) { return i.it_; }
208 template <class It>
209 bidirectional_iterator(It) -> bidirectional_iterator<It>;
212 template <class It>
215 It it_;
221 typedef typename std::iterator_traits<It>::value_type value_type;
222 typedef typename std::iterator_traits<It>::difference_type difference_type;
223 typedef It pointer;
224 typedef typename std::iterator_traits<It>::reference reference;
227 TEST_CONSTEXPR explicit random_access_iterator(It it) : it_(it) {}
260 friend TEST_CONSTEXPR It base(const random_access_iterator& i) { return i.it_; }
266 template <class It>
267 random_access_iterator(It) -> random_access_iterator<It>;
272 template <std::random_access_iterator It>
274 It it_;
283 using value_type = typename std::iterator_traits<It>::value_type;
284 using difference_type = typename std::iterator_traits<It>::difference_type;
287 constexpr explicit cpp20_random_access_iterator(It it) : it_(it) {}
355 friend constexpr It base(const cpp20_random_access_iterator& i) { return i.it_; }
360 template <class It>
361 cpp20_random_access_iterator(It) -> cpp20_random_access_iterator<It>;
365 template <std::contiguous_iterator It>
367 It it_;
375 using value_type = typename std::iterator_traits<It>::value_type;
376 using difference_type = typename std::iterator_traits<It>::difference_type;
377 using pointer = typename std::iterator_traits<It>::pointer;
378 using reference = typename std::iterator_traits<It>::reference;
381 constexpr It base() const { return it_; }
384 constexpr explicit contiguous_iterator(It it) : it_(it) {}
448 friend constexpr It base(const contiguous_iterator& i) { return i.it_; }
453 template <class It>
454 contiguous_iterator(It) -> contiguous_iterator<It>;
456 template <class It>
459 static_assert(std::is_pointer_v<It>, "Things probably break in this case");
461 It it_;
467 typedef typename std::iterator_traits<It>::value_type value_type;
468 typedef typename std::iterator_traits<It>::difference_type difference_type;
469 typedef It pointer;
470 typedef typename std::iterator_traits<It>::reference reference;
471 typedef typename std::remove_pointer<It>::type element_type;
473 constexpr It base() const {return it_;}
476 constexpr explicit three_way_contiguous_iterator(It it) : it_(it) {}
510 template <class It>
511 three_way_contiguous_iterator(It) -> three_way_contiguous_iterator<It>;
699 template <class It>
702 It it_;
706 using value_type = std::iter_value_t<It>;
707 using difference_type = std::iter_difference_t<It>;
710 constexpr explicit cpp20_input_iterator(It it) : it_(it) {}
717 friend constexpr It base(const cpp20_input_iterator& i) { return i.it_; }
722 template <class It>
723 cpp20_input_iterator(It) -> cpp20_input_iterator<It>;
735 template <class It>
737 It it_;
741 using difference_type = std::iter_difference_t<It>;
743 constexpr explicit cpp20_output_iterator(It it) : it_(it) {}
754 friend constexpr It base(const cpp20_output_iterator& i) { return i.it_; }
759 template <class It>
760 cpp20_output_iterator(It) -> cpp20_output_iterator<It>;
776 constexpr explicit common_input_iterator(Base it) : it_(it) {}
792 std::size_t increments = 0; ///< Number of times the iterator moved forward (++it, it++, it+=positive, it-=negative).
793 std::size_t decrements = 0; ///< Number of times the iterator moved backward (--it, it--, it-=positive, it+=negative).
794 std::size_t zero_moves = 0; ///< Number of times a call was made to move the iterator by 0 positions (it+=0, it-=0).
801 template <class It>
804 using value_type = typename iter_value_or_void<It>::type;
805 using difference_type = std::iter_difference_t<It>;
807 std::conditional_t<std::contiguous_iterator<It>, std::contiguous_iterator_tag,
808 std::conditional_t<std::random_access_iterator<It>, std::random_access_iterator_tag,
809 std::conditional_t<std::bidirectional_iterator<It>, std::bidirectional_iterator_tag,
810 std::conditional_t<std::forward_iterator<It>, std::forward_iterator_tag,
811 std::conditional_t<std::input_iterator<It>, std::input_iterator_tag,
817 requires std::default_initializable<It>
820 constexpr explicit operation_counting_iterator(It const& it, IteratorOpCounts* counts = nullptr)
821 : base_(base(it)), counts_(counts) {}
829 friend constexpr It base(operation_counting_iterator const& it) { return It(it.base_); }
831 constexpr decltype(auto) operator*() const { return *It(base_); }
833 constexpr decltype(auto) operator[](difference_type n) const { return It(base_)[n]; }
836 It tmp(base_);
845 requires std::forward_iterator<It>
853 requires std::bidirectional_iterator<It>
855 It tmp(base_);
862 requires std::bidirectional_iterator<It>
870 requires std::random_access_iterator<It>
872 It tmp(base_);
879 requires std::random_access_iterator<It>
881 It tmp(base_);
887 friend constexpr operation_counting_iterator operator+(operation_counting_iterator it, difference_type n)
888 requires std::random_access_iterator<It>
890 return it += n;
893 friend constexpr operation_counting_iterator operator+(difference_type n, operation_counting_iterator it)
894 requires std::random_access_iterator<It>
896 return it += n;
899 friend constexpr operation_counting_iterator operator-(operation_counting_iterator it, difference_type n)
900 requires std::random_access_iterator<It>
902 return it -= n;
907 requires std::sized_sentinel_for<It, It>
918 requires std::sentinel_for<It, It>
921 return It(base_) == It(other.base_);
925 requires std::random_access_iterator<It>
927 return It(x.base_) < It(y.base_);
931 requires std::random_access_iterator<It>
933 return It(x.base_) > It(y.base_);
937 requires std::random_access_iterator<It>
939 return It(x.base_) <= It(y.base_);
943 requires std::random_access_iterator<It>
945 return It(x.base_) >= It(y.base_);
963 decltype(base(std::declval<It>())) base_;
966 template <class It>
967 operation_counting_iterator(It) -> operation_counting_iterator<It>;
972 template <class It>
976 constexpr explicit sentinel_wrapper(const It& it) : base_(base(it)) {}
977 constexpr bool operator==(const It& other) const {
985 friend constexpr It base(const sentinel_wrapper& s) { return It(s.base_); }
987 decltype(base(std::declval<It>())) base_;
989 template <class It>
990 sentinel_wrapper(It) -> sentinel_wrapper<It>;
992 template <class It>
996 constexpr explicit sized_sentinel(const It& it) : base_(base(it)) {}
997 constexpr bool operator==(const It& other) const { return base_ == base(other); }
998 friend constexpr auto operator-(const sized_sentinel& s, const It& i) { return s.base_ - base(i); }
999 friend constexpr auto operator-(const It& i, const sized_sentinel& s) { return base(i) - s.base_; }
1000 friend constexpr It base(const sized_sentinel& s) { return It(s.base_); }
1002 decltype(base(std::declval<It>())) base_;
1004 template <class It>
1005 sized_sentinel(It) -> sized_sentinel<It>;
1112 constexpr rvalue_iterator(T* it) : it_(it) {}
1140 tmp.it += n;
1151 tmp.it -= n;
1182 // Proxy that can wrap a value or a reference. It simulates C++23's tuple
1185 // of swap to cause a compilation error if it's used in an algorithm that relies
1236 // over the templated `operator=` above because it's a better match).
1286 // It wraps `Base` iterator and when dereferenced it returns a Proxy<ref>
1287 // It simulates C++23's zip_view::iterator but simplified to just wrap
1289 // Note it forwards value_type, iter_move, iter_swap. e.g if the base
1340 // Note std::move(*it) returns Proxy<Foo&>&&, which is not what we want as
1341 // it will likely result in a copy rather than a move