I'm trying to implement comparable on a struct Pitch, that has a computed property called value. The computed property is marked 'mutating get' as it needs to modify this instance property. But when I try and extend so as to make the struct comparable, I get an error next to the return line saying:
Cannot use mutating getter on immutable value: 'lhs' is a 'let' constant
extension Pitch: Comparable {
public static func < (lhs: Pitch, rhs: Pitch) -> Bool {
return lhs.value < rhs.value
}
Any idea how to fix this please?