Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::ranges::prev

      From cppreference.com
      <cpp‎ |experimental‎ |ranges
       
       
       
       
      Iterators library
      Iterator concepts
      Indirect callable concepts
                                                        
                                                        
                                                        
      Common algorithm requirements
                                                        
      Concept utilities
      Iterator utilities and operations
      prev
      Iterator traits
      Iterator adaptors
      Stream iterators
       
      namespace{

         constexpr/* unspecified */ prev=/* unspecified */;

      }
      (ranges TS)
      (customization point object)
      Call signature
      template< Iterator I>
      constexpr I prev( I i);
      (1)
      template< Iterator I>
      constexpr I prev( I i, ranges::difference_type_t<I> n);
      (2)
      template< Iterator I>
      constexpr I prev( I i, ranges::difference_type_t<I> n, I bound);
      (3)

      Decrements the iteratorin times, or untilbound is reached, whichever comes first, and returns the decremented iterator.

      1) Equivalent to--i;return i;.
      2) Equivalent toranges::advance(i,-n);return i;.
      3) Equivalent toranges::advance(i,-n, bound);return i;.

      Contents

      [edit] Customization point objects

      The nameranges::prev denotes acustomization point object, which is afunction object of aliteralSemiregular class type (denoted, for exposition purposes, asPrevT). All instances ofPrevT are equal. Thus,ranges::prev can be copied freely and its copies can be used interchangeably.

      Given a set of typesArgs..., ifstd::declval<Args>()... meet the requirements for arguments toranges::prev above,PrevT will satisfyranges::Invocable<const PrevT, Args...>. Otherwise, no function call operator ofPrevT participates in overload resolution.

      In every translation unit in whichranges::prev is defined, it refers to the same instance of the customization point object. (This means that it can be used freely in things like inline functions and function templates without violating theone-definition rule.)

      [edit]Return value

      The decremented iterator.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      (C++11)
      decrement an iterator
      (function template)[edit]
      advances an iterator by given distance
      (function template)[edit]
      increment an iterator
      (function template)[edit]
      returns the distance between an iterator and a sentinel, or between the beginning and the end of a range
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/ranges/iterator/prev&oldid=155545"

      [8]ページ先頭

      ©2009-2026 Movatter.jp