cast<Y extends RType> method

  1. @override
NativeMemoryPointer<Y> cast<Y extends RType>()
override

Reinterprets this pointer as pointing to Y instead of X.

Same address/offset, no copy, no runtime check, purely a compile-time relabeling of what the memory is assumed to contain. The caller is responsible for Y actually matching the underlying data.

Implementation

@override
NativeMemoryPointer<Y> cast<Y extends RType>() => .new(_ptr);