Loading [MathJax]/extensions/tex2jax.js
kumi v3.1.0
Exquisite Epidote
 
All Classes Namespaces Functions Variables Friends Modules Pages Concepts
Loading...
Searching...
No Matches

◆ bit_or() [2/2]

template<product_type Tuple, typename Value >
constexpr auto kumi::bit_or ( Tuple &&  t,
Value  init 
)
constexpr

Computes the bitwise OR of all elements.

Parameters
tTuple to operate on
initInitial value of the product
Returns
The value of get<0>(t) | ... | get<N-1>(t) & init

Helper type

namespace kumi::result
{
template<product_type Tuple, typename Value> struct bit_or;
template<product_type Tuple, typename Value>
using prod_t = typename bit_or_t<Tuple,Value>::type;
}
constexpr auto bit_or(Tuple &&t, Value init)
Computes the bitwise OR of all elements.
Definition reduce.hpp:217

Computes the return type of a call to kumi::bit_or

Example

#include <kumi/tuple.hpp>
#include <iostream>
int main()
{
auto t = kumi::tuple{1,short{8},' ', 4ULL};
std::cout << kumi::bit_or(t, 0) << "\n";
std::cout << kumi::bit_or(t) << "\n";
}
constexpr auto from_tuple(tuple< Ts... > const &t)
Converts a kumi::tuple to an instance of an arbitrary type.
Definition convert.hpp:59
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:35