tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
logical_and.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_FUNCTIONAL_LOGICAL_AND_HPP
4#define TETL_FUNCTIONAL_LOGICAL_AND_HPP
5
7
8namespace etl {
9
13template <typename T = void>
15 [[nodiscard]] constexpr auto operator()(T const& lhs, T const& rhs) const -> bool { return lhs && rhs; }
16};
17
18template <>
19struct logical_and<void> {
20 using is_transparent = void;
21
22 template <typename T, typename U>
23 [[nodiscard]] constexpr auto operator()(T&& lhs, U&& rhs) const
24 noexcept(noexcept(etl::forward<T>(lhs) && etl::forward<U>(rhs)))
25 -> decltype(etl::forward<T>(lhs) && etl::forward<U>(rhs))
26 {
27 return etl::forward<T>(lhs) && etl::forward<U>(rhs);
28 }
29};
30
31} // namespace etl
32
33#endif // TETL_FUNCTIONAL_LOGICAL_AND_HPP
Definition adjacent_find.hpp:8
constexpr auto forward(remove_reference_t< T > &param) noexcept -> T &&
Forwards lvalues as either lvalues or as rvalues, depending on T. When t is a forwarding reference (a...
Definition forward.hpp:18
void is_transparent
Definition logical_and.hpp:20
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 logical_and.hpp:23
Function object for performing logical AND (logical conjunction). Effectively calls operator&& on typ...
Definition logical_and.hpp:14
constexpr auto operator()(T const &lhs, T const &rhs) const -> bool
Definition logical_and.hpp:15