25 #ifndef SVNXX_DETAIL_FUTURE_HPP
26 #define SVNXX_DETAIL_FUTURE_HPP
32 namespace subversion {
39 using shared_ptr = std::shared_ptr<result>;
40 using unique_ptr = std::unique_ptr<result>;
50 : shared_result(that.shared_result)
54 : shared_result(std::move(that.shared_result))
58 : shared_result(shared_result_)
62 shared_ptr shared_result;
78 using inherited = std::shared_future<T>;
80 shared_future(inherited&& that, shared_ptr shared_result_) noexcept
98 using inherited::valid;
99 using inherited::wait;
100 using inherited::wait_for;
101 using inherited::wait_until;
113 explicit future_base(unique_ptr&& unique_result_) noexcept;
115 shared_ptr share() noexcept;
118 unique_ptr unique_result;
127 class future :
private std::future<T>,
134 using inherited = std::future<T>;
136 future(inherited&& that, unique_ptr&& unique_result_) noexcept
137 : inherited(std::move(that)),
future_base(std::move(unique_result_))
143 future(future&& that) noexcept
144 : inherited(std::move(that)), future_base(std::move(that))
147 shared_future<T> share() noexcept
149 return shared_future<T>(std::move(*
this));
152 using inherited::get;
153 using inherited::valid;
154 using inherited::wait;
155 using inherited::wait_for;
156 using inherited::wait_until;
161 inline shared_future<T>::shared_future(future<T>&& that) noexcept
162 : inherited(std::move(that)), shared_future_base(that.future_base::share())
167 template<
typename T>
using future = future_::future<T>;
168 template<
typename T>
using shared_future = future_::shared_future<T>;
175 #endif // SVNXX_DETAIL_FUTURE_HPP