RosettaCodeData/Task/Higher-order-functions/Swift/higher-order-functions-2.swift
2023-07-01 13:44:08 -04:00

2 lines
102 B
Swift

func func3<T>(f: (Int,Int)->T) -> T { return f(1, 2) }
println(func3 {(x, y) in x + y}) // prints "3"