Callable object computing the bitwise XOR of all elements.
On record types, this function operates on the underlying values, not on the fields themselves.
- Note
- For associative operations, this produces the same result as a left or right fold, but have different intermediate evaluation order.
inline constexpr
#include <kumi/algorithm/reduce.hpp>
template<product_type T>
constexpr bit_xor_t bit_xor
Callable object computing the bitwise XOR of all elements.
Definition reduce.hpp:632
template<product_type T, typename V>
constexpr auto bit_xor(T && t, V init);
- t: Product Type to operate on
- init: Optional initial value of the reduction.
The result of the computation of `get<0>(t) ^ ... ^ get<N-1>(t) ^ init`
namespace kumi::result
{
template<product_type T,
typename Value>
struct bit_xor;
template<product_type T, typename Value>
}
Computes the return type of a call to kumi::bit_xor
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto t =
kumi::record{
"a"_id = 1,
"b"_id =
short{8},
"c"_id =
' ',
"d"_id = 4ULL};
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36