tqchen commented on code in PR #266:
URL: https://github.com/apache/tvm-ffi/pull/266#discussion_r2532318946


##########
include/tvm/ffi/function.h:
##########
@@ -487,10 +497,10 @@ class Function : public ObjectRef {
    * \param callable the internal container of packed function.
    */
   template <typename TCallable>
-  static Function FromTyped(TCallable callable) {
-    using FuncInfo = details::FunctionInfo<TCallable>;
-    auto call_packed = [callable = std::move(callable)](const AnyView* args, 
int32_t num_args,
-                                                        Any* rv) mutable -> 
void {
+  static Function FromTyped(TCallable&& callable) {
+    using FuncInfo = details::FunctionInfo<std::decay_t<TCallable>>;
+    auto call_packed = [callable = std::forward<TCallable>(callable)](

Review Comment:
   thanks for the explaination, can we add a comment here stating that callable 
is always pass by value
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to