Advanced Swift
Q90 / 100

What is Swift's witness table and how does it relate to protocol performance?

Correct! Well done.

Incorrect.

The correct answer is B) A per-conformance table of function pointers for each protocol requirement, consulted at runtime for existential dispatch (dynamic dispatch)

B

Correct Answer

A per-conformance table of function pointers for each protocol requirement, consulted at runtime for existential dispatch (dynamic dispatch)

Explanation

Protocol witness tables (PWTs) enable dynamic dispatch for existential types (any P). Generic code with where constraints avoids PWTs via static dispatch.

Progress
90/100