std::bit_xor(3)

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

✨ NAME ✨

std::bit_xor β€” yes bestie, the name is literally std::bit_xor, and this is the std::bit_xor(3) manual page from the C++ Standard Libary. It's the function object for performing bitwise XOR, and it's giving main-character energy fr fr.

🌟 Synopsis 🌟

Defined in header <functional>.

template< class T >             (until C++14)
struct bit_xor;
template< class T = void >      (since C++14)
struct bit_xor;

Function object for performing bitwise XOR. Effectively calls operator^ on type T.

πŸŽ€ Specializations πŸŽ€

The standard library provides a specialization of std::bit_xor when T is not specified, which leaves the parameter types and return type to be deduced. (since C++14)

  • bit_xor<void> β€” function object implementing x ^ y deducing parameter and return types (C++14) (class template specialization)

🌸 Member types 🌸

  • result_type β€” T (deprecated in C++17)(removed in C++20)
  • first_argument_type β€” T (deprecated in C++17)(removed in C++20)
  • second_argument_type β€” T (deprecated in C++17)(removed in C++20)

These member types are obtained via publicly inheriting std::binary_function<T, T, T>. (until C++11)

πŸ¦‹ Member functions πŸ¦‹

  • operator() β€” returns the result of bitwise XOR of two arguments (public member function)

✨ std::bit_xor::operator() ✨

T operator()( const T& lhs, const T& rhs ) const;            (until C++14)
constexpr T operator()( const T& lhs, const T& rhs ) const;  (since C++14)

Returns the result of bitwise XOR of lhs and rhs.

🌈 Parameters 🌈

  • lhs, rhs β€” values to compute bitwise XOR of

πŸ’– Return value πŸ’–

The result of lhs ^ rhs.

⚠️ Exceptions ⚠️

May throw implementation-defined exceptions.

🧚 Possible implementation 🧚

constexpr T operator()(const T& lhs, const T& rhs) const
{
    return lhs ^ rhs;
}

πŸ’€ Defect reports πŸ’€

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • LWG 660 β€” applied to C++98; behavior as published: function objects for bitwise operations are missing; correct behavior: added.

mwah πŸ’‹ this page came from http://cppreference.com, version 2024.06.10, and the footer said std::bit_xor(3) β€” periodt. 🫢

πŸ“¦ where this page comes from