cppwinrt/strings
Raymond Chen bf4459b25a
Allow resume_agile to be stored in a variable (#1358)
`resume_agile` exposes the ability to save the `await_adapter`
in a variable. This was not possible without `resume_agile` because
the `await_adapter` had previously been available only via
`operator co_await`, which means that it is created only in
response to an immediate attempt to `co_await` it, so we knew
that it would be consumed before its argument (possibly a temporary)
was destructed.

`resume_agile` returns the `await_adapter`, and we expect people
to await it immediately, but it's possible that they decide to
save it in a variable and await it later. In that case, we have
to record the `Async` as a value instead of a reference. We forward
the `resume_agile` argument into the `Async` so that it moves
if given an rvalue reference, or copies if given an lvalue reference.
This ensure that the common case where somebody does
`co_await resume_agile(DoSomething())`, we do not incur any additional
AddRefs or Releases.

Now that it's possible to `co_await` the `await_adapter` twice,
we have to worry about `await_suspend` being called twice. It had
previously assumed that `suspending` was true (since that's how it
was constructed), but that is no longer valid in the `resume_agile`
case if somebody tries to await the `resume_agile` twice. So we have
to force it to `true`. (Now, the second await will fail with
"illegal delegate assignment", but our failure to set `suspending`
to `true` led to double-resumption, which is super-bad.)
2023-09-14 16:19:23 -07:00
..
base_abi.h Improve compatibility with mingw-w64 in generated headers (#1200) 2022-10-13 09:40:49 -05:00
base_activation.h Remove old Windows 7 support code (#1348) 2023-08-28 08:35:09 -05:00
base_agile_ref.h Remove old Windows 7 support code (#1348) 2023-08-28 08:35:09 -05:00
base_array.h Support for std::span for winrt::array_view and winrt::com_array (#1343) 2023-08-28 10:24:04 -07:00
base_chrono.h Make compatible with GCC (#1245) 2022-12-13 11:32:15 -06:00
base_collections.h C++20 ranges support (#900) 2021-03-29 10:47:25 -07:00
base_collections_base.h Make vector<bool> work again (#703) 2020-07-29 12:14:59 -07:00
base_collections_input_iterable.h port 2019-10-08 08:19:10 -07:00
base_collections_input_map.h Add multi-threaded collections (#692) 2020-07-28 12:53:45 -07:00
base_collections_input_map_view.h port 2019-10-08 08:19:10 -07:00
base_collections_input_vector.h Fix Clang 15 style warnings (#1196) 2022-10-10 10:10:21 -05:00
base_collections_input_vector_view.h port 2019-10-08 08:19:10 -07:00
base_collections_map.h Add multi-threaded collections (#692) 2020-07-28 12:53:45 -07:00
base_collections_vector.h Avoid exception in observable IndexOf implementation (#1017) 2021-09-13 10:00:52 -07:00
base_com_ptr.h Add `capture` support for unconventional result types (#1301) 2023-04-29 14:53:13 -05:00
base_composable.h Improve compatibility with mingw-w64 in generated headers (#1200) 2022-10-13 09:40:49 -05:00
base_coroutine_foundation.h Allow resume_agile to be stored in a variable (#1358) 2023-09-14 16:19:23 -07:00
base_coroutine_system.h Define co_await operators for C++20 coroutines as well (#764) (#765) 2020-10-15 11:12:24 -07:00
base_coroutine_system_winui.h Define co_await operators for C++20 coroutines as well (#764) (#765) 2020-10-15 11:12:24 -07:00
base_coroutine_threadpool.h Add `resume_agile` to allow coroutine to resume in any apartment (#1356) 2023-09-12 13:25:16 -05:00
base_coroutine_ui_core.h Define co_await operators for C++20 coroutines as well (#764) (#765) 2020-10-15 11:12:24 -07:00
base_deferral.h Define co_await operators for C++20 coroutines as well (#764) (#765) 2020-10-15 11:12:24 -07:00
base_delegate.h Increase foldability of various templates (#1338) 2023-08-09 23:40:40 -07:00
base_error.h Remove old Windows 7 support code (#1348) 2023-08-28 08:35:09 -05:00
base_events.h Remove old Windows 7 support code (#1348) 2023-08-28 08:35:09 -05:00
base_extern.h Remove old Windows 7 support code (#1348) 2023-08-28 08:35:09 -05:00
base_fast_forward.h Improve compatibility with mingw-w64 in generated headers (#1200) 2022-10-13 09:40:49 -05:00
base_foundation.h Revert utf-8 encoding of runtime class names (#621) 2020-05-13 14:18:42 -07:00
base_handle.h Harden put functions against misuse (#986) 2021-07-21 15:47:20 -07:00
base_identity.h Cleaning up some warnings for Clang and GCC (#1255) 2023-01-09 08:57:33 -06:00
base_implements.h Improve GCC compatibility (#1352) 2023-09-02 12:14:52 -05:00
base_includes.h Support for std::span for winrt::array_view and winrt::com_array (#1343) 2023-08-28 10:24:04 -07:00
base_iterator.h C++20 ranges support (#900) 2021-03-29 10:47:25 -07:00
base_lock.h Add multi-threaded collections (#692) 2020-07-28 12:53:45 -07:00
base_macros.h Add a mechanism to suppress `std::source_location` (#1260) 2023-01-09 16:52:54 -06:00
base_marshaler.h Move externs into "impl" category (#475) 2020-01-16 14:17:18 -08:00
base_meta.h Add `resume_agile` to allow coroutine to resume in any apartment (#1356) 2023-09-12 13:25:16 -05:00
base_natvis.h Avoid spurious WINRT_NATVIS redefinition warning (#1044) 2021-10-21 09:52:05 -07:00
base_reference_produce.h Improve diagnostics when trying to use classic COM without <unknwn.h> (#1022) 2021-09-20 10:20:06 -07:00
base_reference_produce_1.h IReference operators in level-1 header should be forward declarations (#965) 2021-06-24 12:42:43 -07:00
base_security.h Revert "Prevent inadvertent assignment to temporary object" (#976) 2021-07-07 07:14:04 -07:00
base_std_hash.h Support for Windows 7 (#469) 2020-01-14 11:13:12 -08:00
base_string.h Make headers partially usable with LLVM/libc++ 13 (#1257) 2023-01-03 11:33:53 -06:00
base_string_input.h Cleaning up some warnings for Clang and GCC (#1255) 2023-01-09 08:57:33 -06:00
base_string_operators.h Partial GCC compatibility improvements (#1234) 2022-11-21 11:59:13 -06:00
base_stringable_format.h Make the formatter for IStringable const (#1270) 2023-02-05 15:21:16 -06:00
base_stringable_format_1.h Make the formatter for IStringable const (#1270) 2023-02-05 15:21:16 -06:00
base_stringable_streams.h C++ Streams support for hstring and IStringable (#1221) 2022-11-01 09:53:33 -05:00
base_stringable_to_hstring.h Add `to_hstring` overload for `IStringable` (#1271) 2023-02-20 09:38:23 -06:00
base_types.h Add guid brace parsing (#1109) 2022-02-24 09:38:15 -08:00
base_version.h Cleaning up some warnings for Clang and GCC (#1255) 2023-01-09 08:57:33 -06:00
base_version_odr.h Improve detection of mismatched header versions (#683) 2020-07-09 07:37:03 -07:00
base_weak_ref.h Fix null pointer dereference in weak_ref::get() (#1232) 2022-11-21 11:57:55 -06:00
base_windows.h Improve diagnostics when trying to use classic COM without <unknwn.h> (#1022) 2021-09-20 10:20:06 -07:00
base_xaml_component_connector.h Projects with a nested Windows namespace (e.g., Microsoft::Windows) fail to compile (#1223) 2022-11-04 10:02:01 -07:00
base_xaml_component_connector_winui.h Include WinUI too (sigh) (#1224) 2022-11-04 11:14:51 -07:00
base_xaml_typename.h C++20 ranges support (#900) 2021-03-29 10:47:25 -07:00