Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      operator==,!=,<,<=>(std::error_condition)

      From cppreference.com
      <cpp‎ |error‎ |error condition
       
       
      Utilities library
       
      Diagnostics library
       
       
      Defined in header<system_error>
      bool operator==(conststd::error_condition& lhs,
                       conststd::error_condition& rhs)noexcept;
      (1)(since C++11)
      bool operator!=(conststd::error_condition& lhs,
                       conststd::error_condition& rhs)noexcept;
      (2)(since C++11)
      (until C++20)
      bool operator<(conststd::error_condition& lhs,
                     conststd::error_condition& rhs)noexcept;
      (3)(since C++11)
      (until C++20)
      std::strong_ordering operator<=>(conststd::error_condition& lhs,
                                       conststd::error_condition& rhs)noexcept;
      (4)(since C++20)
      bool operator==(conststd::error_code& code,
                       conststd::error_condition& cond)noexcept;
      (5)(since C++11)
      bool operator==(conststd::error_condition& cond,
                       conststd::error_code& code)noexcept;
      (5)(since C++11)
      (until C++20)
      bool operator!=(conststd::error_code& code,
                       conststd::error_condition& cond)noexcept;
      (6)(since C++11)
      (until C++20)
      bool operator!=(conststd::error_condition& cond,
                       conststd::error_code& code)noexcept;
      (6)(since C++11)
      (until C++20)

      Compares two error conditions.

      1) Checks whetherlhs andrhs are equal.
      2) Checks whetherlhs andrhs are not equal.
      3) Checks whetherlhs isless thanrhs.
      4) Obtains three-way comparison result oflhs andrhs.
      5) Checks whethercode is a semantic match forcond.
      6) Checks whethercode is not a semantic match forcond.

      The<,<=,>,>=, and!= operators aresynthesized fromoperator<=> andoperator== respectively.

      (since C++20)

      [edit]Parameters

      lhs, rhs, cond - error conditions to compare
      code - the error code to compare

      [edit]Return value

      1)true if the error category and error value compare equal.
      2)true if the error category or error value compare are not equal.
      3)true iflhs.category()< rhs.category(). Otherwise,true iflhs.category()== rhs.category()&& lhs.value()< rhs.value(). Otherwise,false.
      4)lhs.category()<=> rhs.category() if it is notstd::strong_ordering::equal. Otherwise,lhs.value()<=> rhs.value().
      5)true if eithercode.category().equivalent(code.value(), cond) orcond.category().equivalent(code, cond.value()).
      6)true if neithercode.category().equivalent(code.value(), cond) norcond.category().equivalent(code, cond.value()).

      [edit]See also

      [virtual]
      compareserror_code anderror_condition for equivalence
      (virtual public member function ofstd::error_category)[edit]
      (removed in C++20)(removed in C++20)(C++20)
      compares twoerror_codes
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/error/error_condition/operator_cmp&oldid=157159"

      [8]ページ先頭

      ©2009-2025 Movatter.jp