call

Calls a function on every element in the array.

  1. void call(T array, E args)
  2. void call(T array, E args)
    void
    call
    (
    string func
    T
    E...
    )
    (,)
    if (
    (
    isArray!T ||
    isAssociativeArray!T
    )
    &&
    isSafe!(__traits(getMember, typeof(T.init[0]), func))
    )

Examples

Effect effect = new Effect(Effects.REGENERATION, 60, "V");

// classic method
foreach(ref Player player ; players) {
   player.addEffect(effect);
}

// faster and easier method
players.call!"addEffect"(effect);

Meta