map

Apply a function to each element an array. The function's return values are stored in another array.

  1. Elem2[] map(Elem[] array, Map2E func, Elem2[] buf)
    version(TangoDoc)
    map
    (,,
    Elem2[] buf = null
    )
  2. template map(Func, Array)

Parameters

array Elem[]

the array.

func Map2E

the function to apply.

buf Elem2[]

a buffer in which to store the results. This will be resized if it does not have sufficient space.

Return Value

Type: Elem2[]

an array (the same as the buffer passed in, if possible) where the ith element is the result of applying func to the ith element of the input array

Meta