class Box { var n = 0 } // the parameter references the caller's instance func fill(_ b: Box) { b.n = 42 } let box = Box() fill(box) print(box.n)
the callee can mutate the instance