tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
bit_or.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_FUNCTIONAL_BIT_OR_HPP
4
#define TETL_FUNCTIONAL_BIT_OR_HPP
5
6
#include <
etl/_utility/forward.hpp
>
7
8
namespace
etl
{
9
14
template
<
typename
T =
void
>
15
struct
bit_or
{
16
[[nodiscard]]
constexpr
auto
operator()
(T
const
& lhs, T
const
& rhs)
const
-> T {
return
lhs | rhs; }
17
};
18
19
template
<>
20
struct
bit_or
<void> {
21
using
is_transparent
= void;
22
23
template
<
typename
T,
typename
U>
24
[[nodiscard]]
constexpr
auto
operator()
(T&& lhs, U&& rhs)
const
25
noexcept
(
noexcept
(
etl::forward<T>
(lhs) |
etl::forward<U>
(rhs)))
26
->
decltype
(
etl::forward<T>
(lhs) |
etl::forward<U>
(rhs))
27
{
28
return
etl::forward<T>
(lhs) |
etl::forward<U>
(rhs);
29
}
30
};
31
32
}
// namespace etl
33
34
#endif
// TETL_FUNCTIONAL_BIT_OR_HPP
forward.hpp
etl
Definition
adjacent_find.hpp:8
etl::forward
constexpr auto forward(remove_reference_t< T > ¶m) noexcept -> T &&
Forwards lvalues as either lvalues or as rvalues, depending on T. When t is a forwarding reference (a...
Definition
forward.hpp:18
etl::bit_or< void >::is_transparent
void is_transparent
Definition
bit_or.hpp:21
etl::bit_or< void >::operator()
constexpr auto operator()(T &&lhs, U &&rhs) const noexcept(noexcept(etl::forward< T >(lhs)|etl::forward< U >(rhs))) -> decltype(etl::forward< T >(lhs)|etl::forward< U >(rhs))
Definition
bit_or.hpp:24
etl::bit_or
Function object for performing bitwise OR. Effectively calls operator| on type T.
Definition
bit_or.hpp:15
etl::bit_or::operator()
constexpr auto operator()(T const &lhs, T const &rhs) const -> T
Definition
bit_or.hpp:16
include
etl
_functional
bit_or.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0