Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftcustom operatorsSingle-choice MCQ

What does this custom operator definition fail to compile without, and why?

infix operator <-> : MultiplicationPrecedence func <-> <T>(lhs: inout T, rhs: inout T) { let tmp = lhs lhs = rhs rhs = tmp } var a = 1, b = 2 a <-> b