rcseries

Constructs a RC-allocated series from an associative array. Performs exactly two allocations.

  1. auto rcseries(RV[RK] aa)
    @optmath
    rcseries
    (
    RK
    RV
    K = RK
    V = RV
    )
    (
    RV[RK] aa
    )
    if (
    is(typeof(K.init < K.init)) &&
    is(typeof(Unqual!K.init < Unqual!K.init))
    )
  2. auto rcseries(V[K] aa)
  3. auto rcseries(V[K] aa)
  4. auto rcseries(V[K]* aa)

Parameters

aa RV[RK]

associative array or a pointer to associative array

Return Value

Type: auto

sorted RC-allocated series.

Examples

auto s = [1: 1.5, 3: 3.3, 2: 20.9].rcseries;
assert(s.index == [1, 2, 3]);
assert(s.data == [1.5, 20.9, 3.3]);
assert(s.data[s.findIndex(2)] == 20.9);

See Also

Meta