tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
invoke_r.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_FUNCTIONAL_INVOKE_R_HPP
4#define TETL_FUNCTIONAL_INVOKE_R_HPP
5
10
11namespace etl {
12
14template <typename R, typename F, typename... Args>
15 requires(etl::is_invocable_r_v<R, F, Args...>)
16constexpr auto invoke_r(F&& f, Args&&... args) -> R
17{
18 if constexpr (etl::is_void_v<R>) {
20 } else {
22 }
23}
24
25} // namespace etl
26
27#endif // TETL_FUNCTIONAL_INVOKE_R_HPP
Definition adjacent_find.hpp:8
constexpr bool is_void_v
Definition is_void.hpp:16
constexpr auto invoke_r(F &&f, Args &&... args) -> R
Definition invoke_r.hpp:16
constexpr auto is_invocable_r_v
Definition is_invocable_r.hpp:15
constexpr auto invoke(F &&f, Args &&... args) -> invoke_result_t< F, Args... >
Definition invoke.hpp:45
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