Skip to content

certain non-decomposable senders caus a compilation error #252

@dietmarkuehl

Description

@dietmarkuehl

The following code results in a compilation error:

#include <beman/execution/execution.hpp>
namespace ex = beman::execution;

namespace {
    struct non_decomposable_sender {
        using sender_concept = ex::sender_t;
        template <typename...>
        static consteval auto get_completion_signatures() { return test_std::completion_signatures<ex::set_value_t()>(); }
        non_decomposable_sender(int, int) {}
    };
}

int main() {
    (void)ex::get_completion_signatures<non_decomposible_sender, ex::env<>>();
}

Removing one of the int constructor parameters causes the code to compile!

The issue is that sender is used with ex::tag_of_t which tries to guess whether a type is decomposable. If it think it can decompose objects of a type it will extract a tag. However, the above type can't be decomposed.

Currently, I don't know how to properly fix the problem. The tentative plan is to rather detect if a sender is built using basic_sender (probably indirectly by actually detecting a nested type) and only try to decompose such senders.

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