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