11 using Ptr = TTG_IMPL_NS::Ptr<T>;
13 template<
typename T,
typename... Args>
39 template<
typename... Ts>
40 struct get_ptr_tpl_t {
42 std::tuple<ttg::Ptr<Ts>...> m_ptr_tuple;
43 bool m_is_ready =
false;
45 get_ptr_tpl_t(
bool is_ready, std::tuple<
ttg::ptr<Ts>...>&& ptrs)
46 : m_ptr_tuple(std::forward<std::tuple<
ttg::
Ptr<Ts>...>>(ptrs))
47 , m_is_ready(is_ready)
50 bool await_ready() const noexcept {
54 constexpr
void await_suspend( std::coroutine_handle<> )
const noexcept {
58 auto await_resume() const noexcept {
59 return std::move(m_ptr_tuple);
69 bool m_is_ready =
false;
72 : m_ptr(std::forward<
ttg::
Ptr<T>>(ptr))
73 , m_is_ready(is_ready)
76 bool await_ready() const noexcept {
80 constexpr
void await_suspend( std::coroutine_handle<> )
const noexcept {
84 auto await_resume() const noexcept {
85 return std::move(m_ptr);
101 template<
typename Arg,
typename... Args>
102 auto get_ptr(Arg&& arg, Args&&... args) {
104 using tpl_type = std::tuple<ttg::Ptr<std::decay_t<Arg>, std::decay<Args>...>>;
105 using result_type = std::pair<bool, tpl_type>;
107 if constexpr (
sizeof...(Args) > 0) {
108 return detail::get_ptr_tpl_t<std::decay_t<Arg>, std::decay_t<Args>...>(p.first, std::move(p.second));
109 }
else if constexpr (
sizeof...(Args) == 0) {
110 return detail::get_ptr_t<std::decay_t<Arg>>(p.first, std::move(std::get<0>(p.second)));
top-level TTG namespace contains runtime-neutral functionality
Ptr< std::decay_t< T > > get_ptr(T &&obj)
TTG_IMPL_NS::Ptr< T > Ptr
Ptr< T > make_ptr(Args &&... args)