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#

Included By#

Namespaces#