9 using Ptr = TTG_IMPL_NS::Ptr<T>;
11 template<
typename T,
typename... Args>
27 template<
typename... Ts>
28 struct get_ptr_tpl_t {
30 std::tuple<ttg::Ptr<Ts>...> m_ptr_tuple;
31 bool m_is_ready =
false;
33 get_ptr_tpl_t(
bool is_ready, std::tuple<
ttg::ptr<Ts>...>&& ptrs)
34 : m_ptr_tuple(std::forward<std::tuple<
ttg::
Ptr<Ts>...>>(ptrs))
35 , m_is_ready(is_ready)
38 bool await_ready() const noexcept {
42 constexpr
void await_suspend( std::coroutine_handle<> )
const noexcept {
46 auto await_resume() const noexcept {
47 return std::move(m_ptr_tuple);
57 bool m_is_ready =
false;
60 : m_ptr(std::forward<
ttg::
Ptr<T>>(ptr))
61 , m_is_ready(is_ready)
64 bool await_ready() const noexcept {
68 constexpr
void await_suspend( std::coroutine_handle<> )
const noexcept {
72 auto await_resume() const noexcept {
73 return std::move(m_ptr);
89 template<
typename Arg,
typename... Args>
90 auto get_ptr(Arg&& arg, Args&&... args) {
92 using tpl_type = std::tuple<ttg::Ptr<std::decay_t<Arg>, std::decay<Args>...>>;
93 using result_type = std::pair<bool, tpl_type>;
95 if constexpr (
sizeof...(Args) > 0) {
96 return detail::get_ptr_tpl_t<std::decay_t<Arg>, std::decay_t<Args>...>(p.first, std::move(p.second));
97 }
else if constexpr (
sizeof...(Args) == 0) {
98 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)