-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathfuture.h
More file actions
57 lines (46 loc) · 1.11 KB
/
future.h
File metadata and controls
57 lines (46 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef _GHLIBCPP_FUTURE
#define _GHLIBCPP_FUTURE
namespace std {
enum class launch {
async,
deferred
};
template<typename T>
class future {
public:
future();
future(const future&);
future(future&&);
};
template<typename T>
class shared_future {
public:
shared_future();
shared_future(const shared_future&);
shared_future(shared_future&&);
shared_future(future<T>&&);
};
template<typename T>
class promise {
public:
promise();
promise(const promise&);
promise(promise&&);
future<T> get_future();
};
template<typename Signature>
class packaged_task;
template<typename R, typename... Args>
class packaged_task<R(Args...)> {
public:
packaged_task();
packaged_task(const packaged_task&);
packaged_task(packaged_task&&);
template<typename F> packaged_task(F&&);
};
template<typename F, typename... Args>
auto async(F&&, Args&&...) -> future<decltype(declval<F>()(declval<Args>()...))>;
template<typename F, typename... Args>
auto async(launch, F&&, Args&&...) -> future<decltype(declval<F>()(declval<Args>()...))>;
} // namespace std
#endif // _GHLIBCPP_FUTURE