Reflection module

get_array_count_and_data

procedureSource

The element count and data pointer of the array at pointer, whose type is info. Works for fixed, resizable and view arrays alike.

get_array_count_and_data :: (
    pointer: *void,
    info: *Type_Info_Array
) -> (count: s64, data: *void)

Parameters

pointer: *void
info: *Type_Info_Array

Returns

count: s64
data: *void
Example↗
values := int.[4, 5, 6];
count, data := get_array_count_and_data(*values, cast(*Type_Info_Array) type_info(type_of(values)));
assert(count == 3 && (cast(*int) data).* == 4);

See also