5 #include <libcopp/utils/config/libcopp_build_features.h>
12 #include <type_traits>
22 #if defined(LIBCOPP_MACRO_ENABLE_STD_COROUTINE) && LIBCOPP_MACRO_ENABLE_STD_COROUTINE
24 LIBCOPP_COPP_NAMESPACE_BEGIN
26 template <
class TFUTURE>
27 struct LIBCOPP_COPP_API_HEAD_ONLY some_ready {
29 using type = std::vector<element_type>;
32 template <
class TFUTURE>
33 struct LIBCOPP_COPP_API_HEAD_ONLY any_ready {
34 using element_type =
typename some_ready<TFUTURE>::element_type;
35 using type =
typename some_ready<TFUTURE>::type;
38 template <
class TFUTURE>
39 struct LIBCOPP_COPP_API_HEAD_ONLY all_ready {
40 using element_type =
typename some_ready<TFUTURE>::element_type;
41 using type =
typename some_ready<TFUTURE>::type;
44 template <
class TELEMENT>
45 struct LIBCOPP_COPP_API_HEAD_ONLY some_ready_remove_wrapper;
47 template <
class TELEMENT>
48 struct LIBCOPP_COPP_API_HEAD_ONLY some_ready_remove_wrapper<std::reference_wrapper<TELEMENT>> {
49 using type = TELEMENT;
52 template <
class TELEMENT>
53 struct LIBCOPP_COPP_API_HEAD_ONLY some_ready_remove_wrapper<
gsl::not_null<TELEMENT*>> {
54 using type = TELEMENT;
57 template <
class TELEMENT>
58 struct LIBCOPP_COPP_API_HEAD_ONLY some_ready_remove_wrapper {
59 using type = TELEMENT;
62 template <
class TCONTAINER>
63 struct LIBCOPP_COPP_API_HEAD_ONLY some_ready_container {
64 using container_type =
typename std::decay<TCONTAINER>::type;
66 typename std::decay<typename some_ready_remove_wrapper<typename container_type::value_type>::type>::type;
68 using const_reference_type =
const value_type&;
73 template <
class TELEMENT>
74 struct LIBCOPP_COPP_API_HEAD_ONLY pick_some_reference;
76 template <
class TELEMENT>
77 struct LIBCOPP_COPP_API_HEAD_ONLY pick_some_reference<std::reference_wrapper<TELEMENT>> {
78 inline static TELEMENT& unwrap(std::reference_wrapper<TELEMENT>& input) noexcept {
return input.get(); }
79 inline static const TELEMENT& unwrap(std::reference_wrapper<const TELEMENT>& input) noexcept {
return input.get(); }
82 template <
class TELEMENT>
83 struct LIBCOPP_COPP_API_HEAD_ONLY pick_some_reference<
gsl::not_null<TELEMENT*>> {
88 template <
class TELEMENT>
89 struct LIBCOPP_COPP_API_HEAD_ONLY pick_some_reference {
90 inline static TELEMENT& unwrap(TELEMENT& input) noexcept {
return input; }
91 inline static const TELEMENT& unwrap(
const TELEMENT& input) noexcept {
return input; }
94 LIBCOPP_COPP_NAMESPACE_END
std::shared_ptr< cli::cmd_option_value > value_type