Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      operator-(std::move_iterator<Iter>, std::move_sentinel)

      From cppreference.com
      <cpp‎ |iterator‎ |move 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
      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)
       
       
      template<std::sized_sentinel_for<Iter> S>

      friendconstexprstd::iter_difference_t<Iter>

          operator-(conststd::move_sentinel<S>& s,const move_iterator& i);
      (1)(since C++20)
      template<std::sized_sentinel_for<Iter> S>

      friendconstexprstd::iter_difference_t<Iter>

          operator-(const move_iterator& i,conststd::move_sentinel<S>& s);
      (2)(since C++20)

      Returns the distance between amove_iterator and amove_sentinel.

      These function templates are not visible to ordinaryunqualified orqualified lookup, and can only be found byargument-dependent lookup whenstd::move_iterator<Iter> is an associated class of the arguments.

      Contents

      [edit]Parameters

      i -std::move_iterator<Iter>
      s -std::move_sentinel<S>, whereS modelsstd::sized_sentinel_for<Iter>

      [edit]Return value

      1)s.base()- i.base()
      2)i.base()- s.base()

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      (C++11)
      computes the distance between two iterator adaptors
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/iterator/move_iterator/operator-2&oldid=172567"

      [8]ページ先頭

      ©2009-2025 Movatter.jp