Intermediate Swift
Q49 / 100

What is @autoclosure?

Correct! Well done.

Incorrect.

The correct answer is B) Automatically wraps an argument expression in a closure, enabling lazy evaluation

B

Correct Answer

Automatically wraps an argument expression in a closure, enabling lazy evaluation

Explanation

func assert(_ cond: @autoclosure () -> Bool) { if !cond() { ... } } allows calling assert(x > 0) without the caller explicitly wrapping in {}.

Progress
49/100