boostorg / boostorg/hof

apply - what is the utility of apply?

Open
#55 7 comments 0 reactions 0 assignees View on GitHub
bug document question
Dominant language
C++
Stars
509
Forks
94
PR merge metrics
No merged PRs in 30d

Description

Oh, I believe I have found why I don't understand. The template parameters TS are not part of the function apply
This

```
template
constexpr auto apply(F&& f, Ts&&... xs);
```

should be

```
template
constexpr auto apply(F&& f);
```

The semantics given us

```
assert(apply(f)(xs...) == f(xs...));
```

But the usage is incompatible

```
assert(fit::apply(sum_f(), 1, 2) == 3);
```

that I believe should be

``` c££
assert(fit::apply(sum_f())(1, 2) == 3);
```

Unfortunately the implementation is not inline at all.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.