Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::join_with_view<V,Pattern>::iterator<Const>::operator++,--

      From cppreference.com
      <cpp‎ |ranges‎ |join with view‎ |iterator
       
       
      Ranges library
      Range adaptors
       
       
      constexpr/*iterator*/& operator++();
      (1)(since C++23)
      constexprvoid operator++(int);
      (2)(since C++23)
      constexpr/*iterator*/ operator++(int)

          requiresstd::is_reference_v</*InnerBase*/>&&
                   ranges::forward_range</*Base*/>&&

                   ranges::forward_range</*InnerBase*/>;
      (3)(since C++23)
      constexpr/*iterator*/& operator--()

          requiresstd::is_reference_v</*InnerBase*/>&&
                   ranges::bidirectional_range</*Base*/>&&
                   ranges::bidirectional_range</*InnerBase*/>&&
                   ranges::common_range</*InnerBase*/>&&
                   ranges::bidirectional_range</*PatternBase*/>&&

                   ranges::common_range</*PatternBase*/>;
      (4)(since C++23)
      constexpr/*iterator*/ operator--(int)

          requiresstd::is_reference_v</*InnerBase*/>&&
                   ranges::bidirectional_range</*Base*/>&&
                   ranges::bidirectional_range</*InnerBase*/>&&
                   ranges::common_range</*InnerBase*/>&&
                   ranges::bidirectional_range</*PatternBase*/>&&

                   ranges::common_range</*PatternBase*/>;
      (5)(since C++23)

      Increments or decrements the iterator.

      1) Increments theinner iterator as if bystd::visit([](auto& it){++it;}, inner_it_ );.
      After that, adjusts the inner and outer iterators as follows:
      • If the incremented inner iterator is the past-the-end iterator of the pattern range, it is set to an iterator to the beginning of the next inner range.
      • If the incremented inner iterator is the past-the-end iterator of an inner range, the outer iterator is incremented. Then:
      • If the incremented outer iterator is not the past-the-end iterator of the outer range, the inner iterator is set to an iterator to the beginning of the pattern range.
      • Otherwise, ifstd::is_reference_v<InnerBase > istrue, the inner iterator is set to a pattern iterator holding asingular value.
      • Repeats the operations above until either the inner iterator is not a past-the-end iterator, or the outer iterator is a past-the-end iterator.
      2) Equivalent to++*this;.
      3) Equivalent toauto tmp=*this;
      ++*this;
      return tmp;
      .
      4) If the outer iterator is the past-the-end iterator of the outer range, decrements it and sets the inner iterator to the past-the-end iterator of the last inner range, otherwise do nothing.
      After that, adjusts the inner and outer iterators as follows:
      • If the inner iterator refers to the beginning of an inner range, it is set to the past-the-end iterator of the pattern range.
      • If the inner iterator refers to the beginning of the pattern range, the outer iterator is decremented, and the inner iterator is set to the past-the-end iterator of the previous inner range.
      • Repeats the operations above until the inner iterator does not refer to the beginning of any range.
      Finally, decrements the inner iterator as if bystd::visit([](auto& it){--it;}, inner_it_ );.
      5) Equivalent toauto tmp=*this;
      --*this;
      return tmp;
      .

      [edit]Return value

      1,4)*this
      3,5) A copy of*this that was made before the change.
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/join_with_view/iterator/operator_arith&oldid=176601"

      [8]ページ先頭

      ©2009-2025 Movatter.jp