Swift - Operators and Expressions
What will be the output of the following Swift code?
struct Counter {
var value: Int
static func + (lhs: Counter, rhs: Counter) -> Counter {
return Counter(value: lhs.value + rhs.value)
}
}
let a = Counter(value: 3)
let b = Counter(value: 7)
let c = a + b
print(c.value)