Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftconditional conformanceSingle-choice MCQ

What does this conditional conformance enable, and why is it written with a `where` clause rather than an unconditional extension?

struct Stack<Element> { private var storage: [Element] = [] mutating func push(_ e: Element) { storage.append(e) } } extension Stack: Equatable where Element: Equatable { static func == (l: Stack, r: Stack) -> Bool { l.storage == r.storage } }