-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for function references (free and static member) in bind_…
…back The following program does not compile: https://godbolt.org/z/WfhEc51dY But if we replace the function reference with a lambda, it does: https://godbolt.org/z/jrhTY4nse Constructing a std::tuple with a function type fails but function pointers are allowed. We instantiate _result with std::decay_t<ArgN>... which maps function references to function pointers and then the corresponding std::tuple instantiation does not fail to compile. The problem with the existing code is that, in order to instantiate std::tuple<std::decay_t<ArgN>...>, we first constructed a std::tuple<ArgN> and passed it over. If instead we construct a std::tuple<std::decay_t<ArgN>...> with the function arguments, they will be converted to function pointers and the std::tuple instantiation will compile.
- Loading branch information
1 parent
8a8486d
commit 59c8dd0
Showing
3 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters