Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::iterator_t,std::ranges::const_iterator_t,std::ranges::sentinel_t,std::ranges::const_sentinel_t

      From cppreference.com
      <cpp‎ |ranges
       
       
      Ranges library
      Range adaptors
       
      Defined in header<ranges>
      template<class T>
      using iterator_t= decltype(ranges::begin(std::declval<T&>()));
      (1)(since C++20)
      template<ranges::range R>
      using const_iterator_t= decltype(ranges::cbegin(std::declval<R&>()));
      (2)(since C++23)
      template<ranges::range R>
      using sentinel_t= decltype(ranges::end(std::declval<R&>()));
      (3)(since C++20)
      template<ranges::range R>
      using const_sentinel_t= decltype(ranges::cend(std::declval<R&>()));
      (4)(since C++23)
      1) Used to obtain the iterator type of the typeT.
      2) Used to obtain the constant iterator type of therange typeR.
      3) Used to obtain the sentinel type of the range typeR.
      4) Used to obtain the constant sentinel type of the range typeR.

      Contents

      [edit]Template parameters

      T - a type that can be used instd::ranges::begin
      R - arange type or asized_range type

      [edit]Notes

      iterator_t can be applied to non-range types, e.g. arrays with unknown bound.

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 3946C++23const_iterator_t andconst_sentinel_t were inconsistent
      with the result ofranges::cbegin andranges::cend respectively
      tweaked

      [edit]See also

      computes the associated types of an iterator
      (alias template)[edit]
      obtains size, difference, and value types of a range
      (alias template)[edit]
      obtains reference types of a range
      (alias template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/iterator_t&oldid=175573"

      [8]ページ先頭

      ©2009-2025 Movatter.jp