facebookexperimental / facebookexperimental/libunifex

blocking_kind customization does not compile

Open
#555 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.7k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

With the "recent" blocking_kind rework there are several places in the code that look like this ([godbolt](https://godbolt.org/z/9e1hxGq13)):

```c++
namespace unifex
{
inline constexpr struct blocking_t {
auto operator()() const { return ""; }
} blocking;

namespace _let_v
{
struct _sender {
static constexpr int blocking = 1;

friend auto tag_invoke(const _sender& sender) noexcept {
const char* v = blocking(); // error: called object type 'int' is not a function or function pointer
}
};
}
}
```

For example in `let_value.hpp`:

https://github.com/facebookexperimental/libunifex/blob/2358687423e439e768afd3053d99ab946c4f5933/include/unifex/let_value.hpp#L384-L386

I don't understand how your pipeline even managed to compile libunifex. This godbolt example does not: https://godbolt.org/z/6MdYYM586

Proposed solution:

```c++
blocking_kind pred = unifex::blocking(sender.pred_);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.