Ubospica commented on issue #234:
URL: https://github.com/apache/tvm-ffi/issues/234#issuecomment-3517870367

   Good topic! FYI, we had an implementation for expected (named Result) in 
xgrammar: 
https://github.com/mlc-ai/xgrammar/blob/main/cpp/support/utils.h#L251. Below 
are several of its design choices, which could be helpful for the design here:
   * It forces moving its content in or out of the result object, to eliminate 
the overhead of copying content
   * Provides a `ResultOk` and `ResultErr` util functions that don't require 
explicitly specifying template parameters
   * Allows constructing object / error object with their constructor 
parameters within `ResultOk` and `ResultErr`
   
   The implementation is also attributed to @DarkSharpness. Just wanna paste it 
here for reference


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