mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-06-15 08:26:16 +08:00
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. |
||
|---|---|---|
| .. | ||
| any.hpp | ||
| bad_boxed_cast.hpp | ||
| bind_first.hpp | ||
| bootstrap_stl.hpp | ||
| bootstrap.hpp | ||
| boxed_cast_helper.hpp | ||
| boxed_cast.hpp | ||
| boxed_number.hpp | ||
| boxed_value.hpp | ||
| callable_traits.hpp | ||
| dispatchkit.hpp | ||
| dynamic_object_detail.hpp | ||
| dynamic_object.hpp | ||
| exception_specification.hpp | ||
| function_call_detail.hpp | ||
| function_call.hpp | ||
| function_params.hpp | ||
| function_signature.hpp | ||
| handle_return.hpp | ||
| operators.hpp | ||
| proxy_constructors.hpp | ||
| proxy_functions_detail.hpp | ||
| proxy_functions.hpp | ||
| register_function.hpp | ||
| type_conversions.hpp | ||
| type_info.hpp | ||