Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      operator<,<=,>,>=(std::basic_const_iterator<Iter>)

      From cppreference.com
      <cpp‎ |iterator‎ |basic const 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</*not-a-const-iterator*/ I>

      friendconstexprbool operator<(const I& x,const basic_const_iterator& y)

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (1)(since C++23)
      template</*not-a-const-iterator*/ I>

      friendconstexprbool operator>(const I& x,const basic_const_iterator& y)

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (2)(since C++23)
      template</*not-a-const-iterator*/ I>

      friendconstexprbool operator<=(const I& x,const basic_const_iterator& y)

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (3)(since C++23)
      template</*not-a-const-iterator*/ I>

      friendconstexprbool operator>=(const I& x,const basic_const_iterator& y)

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (4)(since C++23)

      Compare abasic_const_iterator with another value. These function templates are used when the left operand is not abasic_const_iterator.

      I satisfies the exposition-only concept/*not-a-const-iterator*/ if and only if it's not a specialization ofbasic_const_iterator.

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

      Contents

      [edit]Parameters

      x, y - iterators to compare

      [edit]Return value

      1)x< y.base()
      2)x> y.base()
      3)x<= y.base()
      4)x>= y.base()

      [edit]Notes

      If the left operand is abasic_const_iterator, themember comparison functions are used.

      [edit]Example

      Run this code
      #include <iterator> int main(){staticint arr[1];staticconstexprstd::basic_const_iterator<int*> it=std::end(arr);    static_assert(arr< it);}

      [edit]See also

      This section is incomplete
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/iterator/basic_const_iterator/operator_cmp2&oldid=170413"

      [8]ページ先頭

      ©2009-2025 Movatter.jp