Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::iter_value_t,std::iter_reference_t,std::iter_const_reference_t,std::iter_difference_t,std::iter_rvalue_reference_t,std::iter_common_reference_t

      From cppreference.com
      <cpp‎ |iterator
       
       
      Iterator library
      Iterator concepts
      Iterator primitives
      iter_value_titer_difference_titer_reference_titer_const_reference_titer_rvalue_reference_titer_common_reference_t
      (C++20)(C++20)(C++20)(C++23)(C++20)(C++20)
      Algorithm concepts and utilities
      Indirect callable concepts
      Common algorithm requirements
      (C++20)
      (C++20)
      (C++20)
      Utilities
      (C++20)
      Iterator adaptors
      Range access
      (C++11)(C++14)
      (C++14)(C++14)  
      (C++11)(C++14)
      (C++14)(C++14)  
      (C++17)(C++20)
      (C++17)
      (C++17)
       
      Defined in header<iterator>
      template<class T>
      using iter_value_t=/* see below */;
      (1)(since C++20)
      template</*dereferenceable*/ T>
      using iter_reference_t= decltype(*std::declval<T&>());
      (2)(since C++20)
      template<std::indirectly_readable T>

      using iter_const_reference_t=
         std::common_reference_t<const std::iter_value_t<T>&&,

                                  std::iter_reference_t<T>>;
      (3)(since C++23)
      template<class T>
      using iter_difference_t=/* see below */;
      (4)(since C++20)
      template</*dereferenceable*/ T>

          requires/* see below */
      using iter_rvalue_reference_t=

          decltype(ranges::iter_move(std::declval<T&>()));
      (5)(since C++20)
      template<std::indirectly_readable T>

      using iter_common_reference_t=
         std::common_reference_t<std::iter_reference_t<T>,

                                 /*indirect-value-t*/<T>>;
      (6)(since C++20)
      Helper templates
      template<class T>
      concept/*dereferenceable*/=/* see below */;
      (7)(exposition only*)
      template<std::indirectly_readable T>
      using/*indirect-value-t*/=/* see below */;
      (8)(exposition only*)

      Compute the associated types of an iterator.

      1) Computes thevalue type ofT.
      2) Computes thereference type ofT.
      3) Computes theconst reference type ofT.
      4) Computes thedifference type ofT.
      5) Computes thervalue reference type ofT. The constraint on this alias template is satisfied if and only if the expressionranges::iter_move(std::declval<T&>()) is valid and has a referenceable type.
      6) Computes thecommon reference type ofT. This is the common reference type between its reference type and an lvalue reference to its value type.
      7) The exposition-only conceptdereferenceable is satisfied if and only if the expression*std::declval<T&>() is valid and has areferenceable type.
      8) The exposition-only alias templateindirect-value-t denotes the following:
      • std::invoke_result_t<Proj&,/*indirect-value-t*/<I>> ifT is the same asstd::projected<I, Proj> for some typesI andProj.
      • Otherwise,std::iter_value_t<T>&.

      [edit]Defect reports

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

      DRApplied toBehavior as publishedCorrect behavior
      P2609R3C++20std::iter_common_reference_t was defined in terms
      ofstd::iter_value_t<T>& which incorrectly handled
      std::projected types that project into rvalue reference types
      defined in terms of
      /*indirect-value-t*/<T>
      to handle such cases

      [edit]See also

      specifies that a type is indirectly readable by applying operator*
      (concept)[edit]
      specifies that asemiregular type can be incremented with pre- and post-increment operators
      (concept)[edit]
      computes the value type of anindirectly_readable type
      (class template)[edit]
      computes the difference type of aweakly_incrementable type
      (class template)[edit]
      provides uniform interface to the properties of an iterator
      (class template)[edit]
      obtains iterator and sentinel types of a range
      (alias template)[edit]
      obtains reference types of a range
      (alias template)[edit]
      obtains size, difference, and value types of a range
      (alias template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/iterator/iter_t&oldid=175692"

      [8]ページ先頭

      ©2009-2025 Movatter.jp