这是indexloc提供的服务,不要输入任何密码
Skip to content

Bug: exec::repeat_effect fails to compile #1572

@abitblue

Description

@abitblue

I believe there is bug with exec::repeat_effect where using it when any sender results in a compilation failure. Root cause appears to be incorrect function call inside the implementation of repeat_effect_t::transform_sender in exec/repeat_effect_until.hpp. Line 242 calls operator() of repeat_effect_until_t{} with two arguments: a sender and a predicate. However, repeat_effect_until_t::operator() only provides overloads for zero arguments or a single sender argument.

Reproducible Example: https://godbolt.org/z/6434fGKcj

Proposed Patch:

diff --git a/include/exec/repeat_effect_until.hpp b/include/exec/repeat_effect_until.hpp
index c78922c7..72d42934 100644
--- a/include/exec/repeat_effect_until.hpp
+++ b/include/exec/repeat_effect_until.hpp
@@ -239,7 +239,7 @@ namespace exec {
       auto transform_sender(_Sender &&__sndr, __ignore) {
         return __sexpr_apply(
           static_cast<_Sender &&>(__sndr), []<class _Child>(__ignore, __ignore, _Child __child) {
-            return repeat_effect_until_t{}(stdexec::then(std::move(__child)), _never{});
+            return repeat_effect_until_t{}(stdexec::then(std::move(__child), _never{}));
           });
       }
     };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions