Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      operator==, <=>(std::indirect)

      From cppreference.com
      <cpp‎ |memory‎ |indirect
       
       
      Memory management library
      (exposition only*)
      Allocators
      Uninitialized memory algorithms
      Constrained uninitialized memory algorithms
      Memory resources
      Uninitialized storage(until C++20)
      (until C++20*)
      (until C++20*)
      Garbage collector support(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
       
       
      Defined in header<memory>
      Compare twoindirect objects
      template<class U,class A>

      constexprbool operator==(const indirect& lhs,const indirect<U, A>& rhs)

         noexcept(noexcept(*lhs==*rhs));
      (1)(since C++26)
      template<class U,class A>

      constexpr/*synth-three-way-result*/<T, U>

          operator<=>(const indirect& lhs,const indirect<U, A>& rhs);
      (2)(since C++26)
      Compare anindirect object with a value
      template<class U>

      constexprbool operator==(const indirect& ind,const U& value)

         noexcept(noexcept(*lhs== value));
      (3)(since C++26)
      template<class U>

      constexpr/*synth-three-way-result*/<T, U>

          operator<=>(const indirect& ind,const U& value);
      (4)(since C++26)

      Performs comparison operations onindirect objects.

      For the definition of/*synth-three-way-result*/, seesynth-three-way-result .

      1,2) Compares twoindirect objects, the comparison result is defined as follows:
      lhsvaluelessnot valueless
      rhs       valueless           not valueless           valueless           not valueless    
      operator==truefalsefalse*lhs==*rhs
       operator<=> !lhs.valueless_after_move()<=>
         !rhs.valueless_after_move()
      synth-three-way
          (*lhs,*rhs)
      1) If the expression*lhs==*rhs is ill-formed or its result is not convertible tobool, the program is ill-formed.
      3,4) Compare anindirect object with a value, the comparison result is defined as follows:
      Operatorind is valuelessind is not valueless
      operator==false*ind== value
       operator<=> std::strong_ordering::lesssynth-three-way (*ind, value)
      3) If the expression*ind== value is ill-formed or its result is not convertible tobool, the program is ill-formed.

      [edit]Parameters

      lhs, rhs, ind - anindirect object to compare
      value - value to compare to the owned value

      [edit]Return value

      As described above.

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/memory/indirect/operator_cmp&oldid=182557"

      [8]ページ先頭

      ©2009-2025 Movatter.jp