>>206

class ArrayProxy<T> {
private var array = [T]()
func append(newElement: T) {
array.append(newElement)
}
}
func +=<T>(lhs: ArrayProxy<T>, rhs: [T]) {
lhs.array += rhs
}

class Hunter {
let name: String
private(set) var friends = ArrayProxy<Hunter>()
init(_ name: String) {
self.name = name
}
}

let gon = Hunter("ゴン")

// 1
gon.friends.append(Hunter("キルア"))
// 2
gon.friends += [Hunter("クラピカ"), Hunter("レオリオ")]
// 3
gon.friends = [Hunter("ヒソカ"), Hunter("イルミ")]