RefOrNull2 method

Pointer<T> RefOrNull2(
  1. X? o
)

Writes o into slot '2' and returns its pointer, or returns nullptr if o is null.

Use this instead of Ref2 when the C API uses a null pointer to signal "no value".

Implementation

Pointer<T> RefOrNull2(X? o) => o == null ? nullptr : Ref2(o);