Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

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

      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)
       
       
      Equality comparison
      template<std::sentinel_for<Iter> S>
      constexprbool operator==(const S& s)const;
      (1)(since C++23)
      Relational comparisons between twobasic_const_iterators
      constexprbool operator<(const basic_const_iterator& y)const
          requiresstd::random_access_iterator<Iter>;
      (2)(since C++23)
      constexprbool operator>(const basic_const_iterator& y)const
          requiresstd::random_access_iterator<Iter>;
      (3)(since C++23)
      constexprbool operator<=(const basic_const_iterator& y)const
          requiresstd::random_access_iterator<Iter>;
      (4)(since C++23)
      constexprbool operator>=(const basic_const_iterator& y)const
          requiresstd::random_access_iterator<Iter>;
      (5)(since C++23)
      constexprauto operator<=>(const basic_const_iterator& y)const
          requiresstd::random_access_iterator<Iter>&&std::three_way_comparable<Iter>;
      (6)(since C++23)
      Relational comparisons betweenbasic_const_iterator and another type
      template</*different-from*/<basic_const_iterator> I>

      constexprbool operator<(const I& y)const

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (7)(since C++23)
      template</*different-from*/<basic_const_iterator> I>

      constexprbool operator>(const I& y)const

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (8)(since C++23)
      template</*different-from*/<basic_const_iterator> I>

      constexprbool operator<=(const I& y)const

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (9)(since C++23)
      template</*different-from*/<basic_const_iterator> I>

      constexprbool operator>=(const I& y)const

          requiresstd::random_access_iterator<Iter>&&std::totally_ordered_with<Iter, I>;
      (10)(since C++23)
      template</*different-from*/<basic_const_iterator> I>

      constexprauto operator<=>(const I& y)const
          requiresstd::random_access_iterator<Iter>&&
             std::totally_ordered_with<Iter, I>&&

             std::three_way_comparable_with<Iter, I>;
      (11)(since C++23)

      Compares abasic_const_iterator with another value.

      The!= operator issynthesized fromoperator==.

      I satisfies/*different-from*/<basic_const_iterator> ifstd::same_as<I, basic_const_iterator<Iter>> is false.

      Contents

      [edit]Parameters

      s - a sentinel forIter
      y - a value to compare with

      [edit]Return value

      1)base()== s
      2)base()< y.base()
      3)base()> y.base()
      4)base()<= y.base()
      5)base()>= y.base()
      6)base()<=> y.base()
      7)base()< y
      8)base()> y
      9)base()<= y
      10)base()>= y
      11)base()<=> y

      [edit]Notes

      Overload(1) can be used to compare twobasic_const_iterator<Iter> values ifIter modelssentinel_for<Iter>.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

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

      [8]ページ先頭

      ©2009-2025 Movatter.jp