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

You want to overload the standard `<` operator for your type to make it Comparable. What must you do regarding the operator declaration?

struct Money { let cents: Int } extension Money: Comparable { static func < (l: Money, r: Money) -> Bool { l.cents < r.cents } }