Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::ranges::iter_move

      From cppreference.com
      <cpp‎ |iterator
       
       
      Iterator library
      Iterator concepts
      Iterator primitives
      Algorithm concepts and utilities
      Indirect callable concepts
      Common algorithm requirements
      (C++20)
      (C++20)
      (C++20)
      Utilities
      (C++20)
      Iterator adaptors
      Iterator customization points
      ranges::iter_move
      (C++20)
      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>
      inlinenamespace/* unspecified */{

         inlineconstexpr/* unspecified */ iter_move=/* unspecified */;

      }
      (since C++20)
      (customization point object)
      Call signature
      template<class T>

          requires/* see below */

      constexpr decltype(auto) iter_move( T&& t)noexcept(/* see below */);
      (since C++20)

      Obtains an rvalue reference or a prvalue temporary from a given iterator.

      Aranges::iter_move(t) isexpression-equivalent to:

      1. iter_move(t), ift has a class or enumeration type and the expression is well-formed when treated as anunevaluated operand, where theoverload resolution ofiter_move is performed only with the candidates found byargument-dependent lookup.
      2. Otherwise,std::move(*t) if*t is well-formed and is an lvalue.
      3. Otherwise,*t if*t is well-formed and is an rvalue.

      In all other cases, a call toranges::iter_move is ill-formed, which can result insubstitution failure whenranges::iter_move(e) appears in the immediate context of a template instantiation.

      Ifranges::iter_move(e) is not equal to*e, the program is ill-formed, no diagnostic required.

      Customization point objects

      The nameranges::iter_move denotes acustomization point object, which is a constfunction object of aliteralsemiregular class type. SeeCustomizationPointObject for details.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      (C++20)
      casts the result of dereferencing the adjusted underlying iterator to its associated rvalue reference type
      (function)[edit]
      (C++20)
      casts the result of dereferencing the underlying iterator to its associated rvalue reference type
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/iterator/ranges/iter_move&oldid=151410"

      [8]ページ先頭

      ©2009-2025 Movatter.jp