yzh119 opened a new pull request #9748:
URL: https://github.com/apache/tvm/pull/9748


   Currently `Optional` don't have its own `get()` implementation, so if we 
want to get the internal container pointer of an optional object `o` with type 
`Optional<T>`, we can either use `o.value().get()` (in the case it's defined) 
or `static_cast<const T*>(o.get())` (because the inherited `get()` function has 
no type information). Neither of them are satisfactory if we want to get a 
pointer with type `const T*`.
   
   This PR overloads the `get()` function of `Optional`, which returns 
`nullptr` when the object is not defined, and it's corresponding data pointer 
otherwise.
   
   cc @junrushao1994 @tqchen 


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


Reply via email to