File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ namespace asioexec {
9292 at_least_as_qualified_v<std::remove_reference_t <T>, std::remove_reference_t <U>>
9393 && (
9494 // Reference type must agree except...
95- (std::is_lvalue_reference_v<T> == std::is_lvalue_reference_v<T >) ||
95+ (std::is_lvalue_reference_v<T> == std::is_lvalue_reference_v<U >) ||
9696 // ...special rules for const& which allows rvalues to bind thereto
9797 (std::is_lvalue_reference_v<T> && std::is_const_v<std::remove_reference_t <T>>) ))
9898#endif
Original file line number Diff line number Diff line change @@ -1018,4 +1018,19 @@ namespace {
10181018 CHECK (ctx.stopped ());
10191019 }
10201020
1021+ TEST_CASE (
1022+ " Asio operations which declare completion by value but send a mutable lvalue work" ,
1023+ " [asioexec][completion_token]" ) {
1024+ const auto initiating_function = [](auto && token) {
1025+ return asio_impl::async_initiate<decltype (token), void (int )>(
1026+ [](auto && h) {
1027+ int i = 5 ;
1028+ std::forward<decltype (h)>(h)(i);
1029+ },
1030+ token);
1031+ };
1032+ auto op = ::stdexec::connect (initiating_function (completion_token), expect_value_receiver{5 });
1033+ ::stdexec::start (op);
1034+ }
1035+
10211036} // namespace
You can’t perform that action at this time.
0 commit comments