leftibot f894bca836 Fix #612: Allow fun<Signature>(&overloaded) for overload disambiguation
The cheatsheet's "preferred" syntax for binding overloaded free functions,
fun<Ret(Args...)>(&overloaded), only worked on MSVC because the existing
fun<T>(T&&) overload sets T to a function type when called explicitly,
which produces a function rvalue-reference parameter that does not match
a function pointer argument. Standards-conforming compilers (clang, GCC
in some modes) correctly rejected it.

Added two new fun overloads, parameterized on the explicitly-supplied
function-type Signature and using std::type_identity_t to keep that
parameter non-deducible, so they only participate in overload resolution
when Signature is given explicitly. One accepts a free function pointer,
the other a pointer-to-member, enabling both fun<Ret(Args...)>(&free_fn)
and fun<Ret(Args...) cv>(&Class::method) to disambiguate overloads
without resorting to static_cast.
2026-05-02 12:48:28 -06:00
..
chaiscript Fix #612: Allow fun<Signature>(&overloaded) for overload disambiguation 2026-05-02 12:48:28 -06:00