wl_range

Returns a range that iterates over a wl_array.

  1. WlArrayRange!T wl_range(wl_array* arr)
    template wl_range(T)
    static
    WlArrayRange!T
    wl_range
  2. template wl_range(alias member)

Members

Static functions

wl_range
WlArrayRange!T wl_range(wl_array* arr)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

wl_array arr;
wl_array_init(&arr);

foreach(i; 0..1342) {
    int *ptr = cast(int*)wl_array_add(&arr, int.sizeof);
    *ptr = i*12 - 15;

}

int ind=0;
foreach(pi; wl_range!(int)(&arr)) {
    assert(*pi == ind++*12-15);
}
assert(ind==1342);

wl_array_release(&arr);

Meta