swift pass any closer to the function

110

func anyFunc<T>(_ closure: @autoclosure () -> T) {
  let result: T = closure()
  // TODO: Do something with result?
}

anyFunc(print("hello"))

Comments

Submit
0 Comments