FillWith method

Pointer<T> FillWith(
  1. int count,
  2. T init(
    1. Pointer<T>,
    2. int
    ), {
  3. String? key,
})

Fills a tracked slot of count structs by setting each element to the T returned by init(ptr, i).

Implementation

Pointer<T> FillWith(int count, T Function(Pointer<T>, int) init, {String? key}) {
  final p = At(_slotKey(key), count);
  for (int i = 0; i < count; i++) indexSetterFunc(p, i, init(p, i));
  return p;
}