File optional.h#
↰ Parent directory (tvm/ffi)
Runtime Optional container types.
Definition (tvm/ffi/optional.h)#
Detailed Description#
Optional<T> uses a hybrid representation. For types that enable Any storage (TypeTraits<T>::storage_enabled), it is backed by a single Struct TVMFFIAny (Any) with nullopt represented as kTVMFFINone, mirroring Variant<…>; the layout is then independent of T (sizeof == sizeof(Any)) which keeps the ABI stable. For types that do not enable storage (e.g. non-owning view types) it falls back to std::optional<T>.
Includes#
optional(File optional.h)string(File string.h)tvm/ffi/any.h(File any.h)tvm/ffi/error.h(File error.h)tvm/ffi/object.h(File object.h)tvm/ffi/string.h(File string.h)utility