Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::repeat_view<W, Bound>::iterator

      From cppreference.com
      <cpp‎ |ranges‎ |repeat view
       
       
      Ranges library
      Range adaptors
       
       
      struct/*iterator*/;
      (exposition only*)

      ranges::repeat_view<W, Bound>::iterator is the type of the iterators returned bybegin() andend() ofranges::repeat_view<W, Bound>.

      Contents

      [edit]Nested types

      Exposition-only types
      Type Definition
      index-typestd::conditional_t<std::same_as<Bound,std::unreachable_sentinel_t>,
                         std::ptrdiff_t, Bound>
      (exposition-only member type*)
      Iterator property types
      Type Definition
      iterator_conceptstd::random_access_iterator_tag
      iterator_categorystd::random_access_iterator_tag
      value_typeW
      difference_typestd::conditional_t<is-signed-integer-like <index-type >,
                         index-type , iota-diff-t <index-type >>

      [edit]Data members

      Member Definition
      const W*value_ a pointer to the value to repeat
      (exposition-only member object*)
      index-typecurrent_ the current position
      (exposition-only member object*)

      [edit]Member functions

      std::ranges::repeat_view::iterator::iterator

      /*iterator*/()=default;
      (1)(since C++23)
      constexprexplicit/*iterator*/
         (const W* value,/*index-type*/ b=/*index-type*/());
      (2)(since C++23)
      (exposition only*)

      Constructs an iterator. Overload(2) is called bybegin() andend() ofranges::repeat_view.

      1) Initializesvalue_ withnullptr and value-initializescurrent_ .
      2) Initializesvalue_ withvalue andcurrent_ withb.
      IfBound is notstd::unreachable_sentinel_t andb is negative, the behavior is undefined.

      std::ranges::repeat_view::iterator::operator*

      constexprconst W& operator*()constnoexcept;
      (since C++23)

      Returns*value_.

      std::ranges::repeat_view::iterator::operator[]

      constexprconst W& operator[]( difference_type n)constnoexcept;
      (since C++23)

      Returns*(*this+ n).

      std::ranges::repeat_view::iterator::operator++

      constexpr/*iterator*/& operator++();
      (1)(since C++23)
      constexprvoid operator++(int);
      (2)(since C++23)
      1) Equivalent to++current_ ;return*this;.
      2) Equivalent toauto tmp=*this;++*this;return tmp;.

      std::ranges::repeat_view::iterator::operator--

      constexpr/*iterator*/& operator--();
      (1)(since C++23)
      constexpr/*iterator*/ operator--(int);
      (2)(since C++23)
      1) Equivalent to--current_ ;return*this;.
      IfBound is notstd::unreachable_sentinel_t andcurrent_ is non-positive, the behavior is undefined.
      2) Equivalent toauto tmp=*this;--*this;return tmp;.

      std::ranges::repeat_view::iterator::operator+=

      constexpr/*iterator*/& operator+=( difference_type n);
      (since C++23)

      Equivalent tocurrent_ += n;return*this;.

      IfBound is notstd::unreachable_sentinel_t andcurrent_ + n is negative, the behavior is undefined.

      std::ranges::repeat_view::iterator::operator-=

      constexpr/*iterator*/& operator-=( difference_type n);
      (since C++23)

      Equivalent tocurrent_ -= n;return*this;.

      IfBound is notstd::unreachable_sentinel_t andcurrent_ - n is negative, the behavior is undefined.

      [edit]Non-member functions

      operator==, <=>(std::ranges::repeat_view::iterator)

      friendconstexprbool operator==
         (const/*iterator*/& x,const/*iterator*/& y);
      (1)(since C++23)
      friendconstexprauto operator<=>
         (const/*iterator*/& x,const/*iterator*/& y);
      (2)(since C++23)
      1) Returnsx.current_ == y.current_.
      2) Returnsx.current_ <=> y.current_.

      The!= operator issynthesized fromoperator==.

      These functions are not visible to ordinaryunqualified orqualified lookup, and can only be found byargument-dependent lookup wheniterator is an associated class of the arguments.

      operator+(std::ranges::repeat_view::iterator)

      friendconstexpr/*iterator*/ operator+
         (/*iterator*/ i, difference_type n);
      (1)(since C++23)
      friendconstexpr/*iterator*/ operator+
         ( difference_type n,/*iterator*/ i);
      (2)(since C++23)

      Equivalent toi+= n;return i;.

      These functions are not visible to ordinaryunqualified orqualified lookup, and can only be found byargument-dependent lookup wheniterator is an associated class of the arguments.

      operator-(std::ranges::repeat_view::iterator)

      friendconstexpr/*iterator*/ operator-
         (/*iterator*/ i, difference_type n);
      (1)(since C++23)
      friendconstexpr difference_type operator-
         (const/*iterator*/& x,const/*iterator*/& y);
      (2)(since C++23)
      1) Equivalent toi-= n;return i;.
      2) Returnsstatic_cast<difference_type>(x.current_ )-
          static_cast<difference_type>(y.current_ )
      .

      These functions are not visible to ordinaryunqualified orqualified lookup, and can only be found byargument-dependent lookup wheniterator is an associated class of the arguments.

      [edit]Notes

      iterator is alwaysrandom_access_iterator.

      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/repeat_view/iterator&oldid=176949"

      [8]ページ先頭

      ©2009-2025 Movatter.jp