Skip to content

Intrinsic Procedure __array__

IsaacShelton edited this page Mar 21, 2022 · 1 revision

'__array__' method

The __array__ method can be defined in combination with __length__ to allow additional types to be used with the each-in loop.

func __array__(this *MyArrayLike) *$T {

}

The return value is a primitive array pointer, where $T is the element type.

The returned pointer must remain valid until the subject value is destroyed or modified.

Clone this wiki locally