@@ -11,10 +11,10 @@ namespace winrt::impl
1111
1212 inline void __stdcall resume_background_callback (void *, void * context) noexcept
1313 {
14- std::experimental:: coroutine_handle<>::from_address (context)();
14+ coroutine_handle<>::from_address (context)();
1515 };
1616
17- inline auto resume_background (std::experimental:: coroutine_handle<> handle)
17+ inline auto resume_background (coroutine_handle<> handle)
1818 {
1919 submit_threadpool_callback (resume_background_callback, handle.address ());
2020 }
@@ -56,26 +56,26 @@ namespace winrt::impl
5656
5757 inline int32_t __stdcall resume_apartment_callback (com_callback_args* args) noexcept
5858 {
59- std::experimental:: coroutine_handle<>::from_address (args->data )();
59+ coroutine_handle<>::from_address (args->data )();
6060 return 0 ;
6161 };
6262
63- inline void resume_apartment_sync (com_ptr<IContextCallback> const & context, std::experimental:: coroutine_handle<> handle)
63+ inline void resume_apartment_sync (com_ptr<IContextCallback> const & context, coroutine_handle<> handle)
6464 {
6565 com_callback_args args{};
6666 args.data = handle.address ();
6767
6868 check_hresult (context->ContextCallback (resume_apartment_callback, &args, guid_of<ICallbackWithNoReentrancyToApplicationSTA>(), 5 , nullptr ));
6969 }
7070
71- inline void resume_apartment_on_threadpool (com_ptr<IContextCallback> const & context, std::experimental:: coroutine_handle<> handle)
71+ inline void resume_apartment_on_threadpool (com_ptr<IContextCallback> const & context, coroutine_handle<> handle)
7272 {
7373 struct threadpool_resume
7474 {
75- threadpool_resume (com_ptr<IContextCallback> const & context, std::experimental:: coroutine_handle<> handle) :
75+ threadpool_resume (com_ptr<IContextCallback> const & context, coroutine_handle<> handle) :
7676 m_context (context), m_handle(handle) { }
7777 com_ptr<IContextCallback> m_context;
78- std::experimental:: coroutine_handle<> m_handle;
78+ coroutine_handle<> m_handle;
7979 };
8080 auto state = std::make_unique<threadpool_resume>(context, handle);
8181 submit_threadpool_callback ([](void *, void * p)
@@ -86,7 +86,7 @@ namespace winrt::impl
8686 state.release ();
8787 }
8888
89- inline auto resume_apartment (resume_apartment_context const & context, std::experimental:: coroutine_handle<> handle)
89+ inline auto resume_apartment (resume_apartment_context const & context, coroutine_handle<> handle)
9090 {
9191 if ((context.m_context == nullptr ) || (context.m_context == try_capture<IContextCallback>(WINRT_IMPL_CoGetObjectContext)))
9292 {
@@ -246,7 +246,7 @@ namespace winrt::impl
246246 }
247247
248248 template <typename U>
249- auto await_suspend (std::experimental:: coroutine_handle<U> handle)
249+ auto await_suspend (coroutine_handle<U> handle)
250250 {
251251 return awaitable.await_suspend (handle);
252252 }
@@ -278,7 +278,7 @@ WINRT_EXPORT namespace winrt
278278 {
279279 }
280280
281- void await_suspend (std::experimental ::coroutine_handle<> handle) const
281+ void await_suspend (impl ::coroutine_handle<> handle) const
282282 {
283283 impl::resume_background (handle);
284284 }
@@ -305,7 +305,7 @@ WINRT_EXPORT namespace winrt
305305 {
306306 }
307307
308- void await_suspend (std::experimental ::coroutine_handle<> resume)
308+ void await_suspend (impl ::coroutine_handle<> resume)
309309 {
310310 m_resume = resume;
311311
@@ -325,7 +325,7 @@ WINRT_EXPORT namespace winrt
325325 }
326326
327327 T const & m_context;
328- std::experimental ::coroutine_handle<> m_resume{ nullptr };
328+ impl ::coroutine_handle<> m_resume{ nullptr };
329329 };
330330
331331 return awaitable{ context };
@@ -342,7 +342,7 @@ WINRT_EXPORT namespace winrt
342342 {
343343 }
344344
345- void await_suspend (std::experimental ::coroutine_handle<> handle) const
345+ void await_suspend (impl ::coroutine_handle<> handle) const
346346 {
347347 auto copy = context; // resuming may destruct *this, so use a copy
348348 impl::resume_apartment (copy, handle);
@@ -377,7 +377,7 @@ WINRT_EXPORT namespace winrt
377377 return m_duration.count () <= 0 ;
378378 }
379379
380- void await_suspend (std::experimental ::coroutine_handle<> handle)
380+ void await_suspend (impl ::coroutine_handle<> handle)
381381 {
382382 m_handle = handle;
383383 m_timer.attach (check_pointer (WINRT_IMPL_CreateThreadpoolTimer (callback, this , nullptr )));
@@ -435,7 +435,7 @@ WINRT_EXPORT namespace winrt
435435
436436 handle_type<timer_traits> m_timer;
437437 Windows::Foundation::TimeSpan m_duration;
438- std::experimental ::coroutine_handle<> m_handle;
438+ impl ::coroutine_handle<> m_handle;
439439 std::atomic<state> m_state{ state::idle };
440440 };
441441
@@ -475,7 +475,7 @@ WINRT_EXPORT namespace winrt
475475 return WINRT_IMPL_WaitForSingleObject (m_handle, 0 ) == 0 ;
476476 }
477477
478- void await_suspend (std::experimental ::coroutine_handle<> resume)
478+ void await_suspend (impl ::coroutine_handle<> resume)
479479 {
480480 m_resume = resume;
481481 m_wait.attach (check_pointer (WINRT_IMPL_CreateThreadpoolWait (callback, this , nullptr )));
@@ -538,7 +538,7 @@ WINRT_EXPORT namespace winrt
538538 Windows::Foundation::TimeSpan m_timeout;
539539 void * m_handle;
540540 uint32_t m_result{};
541- std::experimental ::coroutine_handle<> m_resume{ nullptr };
541+ impl ::coroutine_handle<> m_resume{ nullptr };
542542 std::atomic<state> m_state{ state::idle };
543543 };
544544
@@ -568,7 +568,7 @@ WINRT_EXPORT namespace winrt
568568 {
569569 }
570570
571- void await_suspend (std::experimental ::coroutine_handle<> handle)
571+ void await_suspend (impl ::coroutine_handle<> handle)
572572 {
573573 if (!WINRT_IMPL_TrySubmitThreadpoolCallback (callback, handle.address (), &m_environment))
574574 {
@@ -580,7 +580,7 @@ WINRT_EXPORT namespace winrt
580580
581581 static void __stdcall callback (void *, void * context) noexcept
582582 {
583- std::experimental ::coroutine_handle<>::from_address (context)();
583+ impl ::coroutine_handle<>::from_address (context)();
584584 }
585585
586586 struct pool_traits
@@ -628,7 +628,11 @@ WINRT_EXPORT namespace winrt
628628 struct fire_and_forget {};
629629}
630630
631+ #ifdef __cpp_lib_coroutine
632+ namespace std
633+ #else
631634namespace std ::experimental
635+ #endif
632636{
633637 template <typename ... Args>
634638 struct coroutine_traits <winrt::fire_and_forget, Args...>
0 commit comments