| 534 | */ |
| 535 | template <typename TCallable> |
| 536 | static Function FromTyped(TCallable&& callable) { |
| 537 | using FuncInfo = details::FunctionInfo<std::decay_t<TCallable>>; |
| 538 | // Callable is always captured by value here to avoid possible dangling reference |
| 539 | auto call_packed = [callable = std::forward<TCallable>(callable)]( |
| 540 | const AnyView* args, int32_t num_args, Any* rv) mutable -> void { |
| 541 | details::unpack_call<typename FuncInfo::RetType>( |
| 542 | std::make_index_sequence<FuncInfo::num_args>{}, nullptr, callable, args, num_args, rv); |
| 543 | }; |
| 544 | return FromPackedInternal(std::move(call_packed)); |
| 545 | } |
| 546 | /*! |
| 547 | * \brief Constructing a packed function from a normal function. |
| 548 | * |
nothing calls this directly
no outgoing calls
no test coverage detected