execution
1.0.1
Portable task execution, timers, and process lifecycle
Toggle main menu visibility
Loading...
Searching...
No Matches
immediate_executor.hpp
Go to the documentation of this file.
1
/*
2
Copyright 2015 Adobe
3
Distributed under the Boost Software License, Version 1.0.
4
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
*/
6
7
/**************************************************************************************************/
8
9
#ifndef STLAB_CONCURRENCY_IMMEDIATE_EXECUTOR_HPP
10
#define STLAB_CONCURRENCY_IMMEDIATE_EXECUTOR_HPP
11
15
16
#include <stlab/execution/config.hpp>
17
18
#include <type_traits>
19
#include <utility>
20
21
/**************************************************************************************************/
22
23
namespace
stlab
{
24
STLAB_EXECUTION_VERSION_NAMESPACE_BEGIN()
25
26
31
32
/**************************************************************************************************/
33
34
namespace execution_detail {
35
36
/**************************************************************************************************/
37
38
struct
immediate_executor_type {
39
template
<
typename
F>
40
auto
operator()(F&& f)
const
-> std::enable_if_t<std::is_nothrow_invocable_v<F>> {
41
std::forward<F>(f)();
42
}
43
};
44
45
/**************************************************************************************************/
46
47
}
// namespace execution_detail
48
49
/**************************************************************************************************/
50
52
inline
constexpr
auto
immediate_executor
= execution_detail::immediate_executor_type{};
53
54
/**************************************************************************************************/
55
57
58
STLAB_EXECUTION_VERSION_NAMESPACE_END()
59
}
// namespace stlab
60
61
/**************************************************************************************************/
62
63
#endif
64
65
/**************************************************************************************************/
stlab::immediate_executor
constexpr auto immediate_executor
Invokes work inline on the calling thread (synchronous executor).
Definition
immediate_executor.hpp:52
stlab
Definition
default_executor.hpp:49
include
stlab
concurrency
immediate_executor.hpp
Generated by
1.18.0