std::error_...::equivalent(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

okay bestie, welcome to std::error_...::equivalent(3) from the C++ Standard Libary manual ✨ (yes, that's the manual name, keeping it exactly as it is). This page is all about std::error_category::equivalent β€” and the name line is literally std::error_category::equivalent again, which is giving main character energy πŸ’….


✨ Synopsis ✨

so std::error_category::equivalent has two virtual overloads, both since C++11 🫢. They check whether an error code is equivalent to an error condition for the error category represented by *this.

  1. (since C++11) virtual bool equivalent( int code, const std::error_condition& condition ) const noexcept;
  2. (since C++11) virtual bool equivalent( const std::error_code& code, int condition ) const noexcept;

what they actually do, lowkey:

  • Overload 1 is equivalent to default_error_condition(code) == condition.
  • Overload 2 is equivalent to *this == code.category() && code.value() == condition.

πŸŽ€ Parameters πŸŽ€

  • code β€” specifies the error code to compare.
  • condition β€” specifies the error condition to compare.

πŸ’– Return value πŸ’–

true if the error code is equivalent to the given error condition for the error category represented by *this, false otherwise. periodt πŸ’…βœ¨


okay bestie, that's the whole page 🫢 β€” source/version vibes: http://cppreference.com, and the date on this one is 2024.06.10. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from