zookeeper-cpp
ZooKeeper Client for C++
future.hpp
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include <zk/config.hpp>
8 
17 #ifndef ZKPP_FUTURE_USE_STD_EXPERIMENTAL
18 # define ZKPP_FUTURE_USE_STD_EXPERIMENTAL 0
19 #endif
20 
35 #ifndef ZKPP_FUTURE_USE_CUSTOM
36 # define ZKPP_FUTURE_USE_CUSTOM 0
37 #endif
38 
43 #ifndef ZKPP_FUTURE_USE_STD
44 # if ZKPP_FUTURE_USE_STD_EXPERIMENTAL || ZKPP_FUTURE_USE_CUSTOM
45 # define ZKPP_FUTURE_USE_STD 0
46 # else
47 # define ZKPP_FUTURE_USE_STD 1
48 # endif
49 #endif
50 
51 #if ZKPP_FUTURE_USE_STD
52 # define ZKPP_FUTURE_INCLUDE <future>
53 # define ZKPP_FUTURE_TEMPLATE std::future
54 # define ZKPP_PROMISE_TEMPLATE std::promise
55 #elif ZKPP_FUTURE_USE_STD_EXPERIMENTAL
56 # define ZKPP_FUTURE_INCLUDE <experimental/future>
57 # define ZKPP_FUTURE_TEMPLATE std::experimental::future
58 # define ZKPP_PROMISE_TEMPLATE std::experimental::promise
59 #elif ZKPP_FUTURE_USE_CUSTOM
60 # if !defined ZKPP_FUTURE_TEMPLATE || !defined ZKPP_PROMISE_TEMPLATE || !defined ZKPP_FUTURE_INCLUDE
61 # error "When ZKPP_FUTURE_USE_CUSTOM is set, you must also define ZKPP_FUTURE_TEMPLATE, ZKPP_PROMISE_TEMPLATE,"
62 # error "and ZKPP_FUTURE_INCLUDE."
63 # endif
64 #else
65 # error "Unknown type to use for zk::future and zk::promise"
66 #endif
67 
68 #include ZKPP_FUTURE_INCLUDE
69 
72 namespace zk
73 {
74 
79 template <typename T>
80 using future = ZKPP_FUTURE_TEMPLATE<T>;
81 
82 template <typename T>
83 using promise = ZKPP_PROMISE_TEMPLATE<T>;
84 
87 }
Definition: acl.cpp:8