guan404ming commented on PR #395:
URL: https://github.com/apache/tvm-ffi/pull/395#issuecomment-3732137440

   > A more general question: if an tvm_ffi.Object's constructor is not 
defined, say its name is Foo, what would Foo() do?
   
   Based on my understanding, I think
   
   1. Object container class (FooObj : public Object): FooObj() calls the 
compiler-generated default constructor, which invokes Object()'s constructor 
and default-initializes member fields. However, I think this might not be the 
prper way to create objects. Should we use `make_object<FooObj>()` instead?
   2. ObjectRef handle class (Foo : public ObjectRef):
       - If using `TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE`: Foo() creates a 
null/undefined reference
       - If using `TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE`: Compilation 
error


-- 
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