std::bit_xor(3)
β¨ 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 implementingx ^ ydeducing 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
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms