YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
fwd.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace yaclib {
4
5#define YACLIB_DEFINE_VOID_COMPARE(type) \
6 constexpr bool operator==(type, type) noexcept { \
7 return true; \
8 } \
9 constexpr bool operator!=(type, type) noexcept { \
10 return false; \
11 } \
12 constexpr bool operator<(type, type) noexcept { \
13 return false; \
14 } \
15 constexpr bool operator<=(type, type) noexcept { \
16 return true; \
17 } \
18 constexpr bool operator>=(type, type) noexcept { \
19 return true; \
20 } \
21 constexpr bool operator>(type, type) noexcept { \
22 return false; \
23 }
24
25#define YACLIB_DEFINE_VOID_TYPE(type) \
26 struct type {}; \
27 YACLIB_DEFINE_VOID_COMPARE(type)
28
31
32struct [[nodiscard]] StopError;
33
34template <typename V = void, typename E = StopError>
35class [[nodiscard]] Result;
36
37template <typename V = void, typename E = StopError>
38class [[nodiscard]] Task;
39
40template <typename V, typename E>
41class FutureBase;
42
43template <typename V = void, typename E = StopError>
44class [[nodiscard]] Future;
45
46template <typename V = void, typename E = StopError>
47class [[nodiscard]] FutureOn;
48
49template <typename V = void, typename E = StopError>
50class [[nodiscard]] Promise;
51
52} // namespace yaclib
Provides a mechanism to access the result of async operations.
Definition future.hpp:20
Provides a mechanism to access the result of async operations.
Definition future.hpp:232
Provides a mechanism to access the result of async operations.
Definition future.hpp:199
Encapsulated return value from caller.
Definition result.hpp:90
Provides a mechanism to schedule the some async operations TODO(MBkkt) add description.
Definition task.hpp:25
#define YACLIB_DEFINE_VOID_TYPE(type)
Definition fwd.hpp:25
Contract< V, E > MakeContract()
Creates related future and promise.
Definition contract.hpp:25
Default error.
Definition result.hpp:26