Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion strings/base_coroutine_foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ namespace winrt::impl
return *this;
}

void operator()(Progress const& result)
void operator()(Progress const& result) const
{
m_promise->set_progress(result);
}
Expand Down
8 changes: 6 additions & 2 deletions test/test/async_progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ namespace
IAsyncOperationWithProgress<int, int> Operation(HANDLE event)
{
co_await resume_on_signal(event);
auto progress = co_await get_progress_token();
progress(123);

// Invoke from a lambda to ensure that operator() is const.
[progress = co_await get_progress_token()]()
{
progress(123);
}();
co_return 1;
}

Expand Down