There was an error while loading. Please reload this page.
The __access__ method can be defined to allow additional types to be used with the element access [] and pointer element access at operators.
__access__
[]
at
func __access__(this *StructValue, index $I) *$T { }
where
$T
$I
The return value is a pointer to the element identified by the given index value.
The following is a simple example of what a definition of the __access__ method might look like:
struct <$T> Array (items *$T, length usize) { /* ... other methods ... */ func __access__(index usize) *$T = this.items at index }
This example is a reduced version of the __access__ method for the standard Array type.
Array
Table of Contents