Variadic function: Difference between revisions

m
(Add Nimrod)
Line 1,548:
Using <tt>...</tt> after the type of argument will take in any number of arguments and put them all in one array of the given type with the given name.
<lang swift>func printAll<T>(things: T...) {
// "things" is a T[T]
for i in things {
println(i)
Anonymous user