ctfeJoin

Generates a mixin string for repeating code. It can be used to unroll variadic arguments. A format string is instantiated a certain number times with an incrementing parameter. The results are then concatenated using an optional joiner.

ctfeJoin
(
size_t length
)
(
in string fmt
,
in string joiner = null
)

Parameters

length

Number of elements you want to join. It is passed into format() as an incrementing number from [0 .. count).

fmt string

The format string to apply on each instanciation. Use %1d$ to refer to the current index multiple times when necessary.

joiner string

Optional string that will be placed between instances. It could be a space or an arithmetic operation.

Return Value

Type:

The combined elements as a mixin string.

See Also

Meta