When defining an operator such as == you can implicitly specify external
parameters:
struct Path: Equatable {
var value: String
static func ==(lhs: Path, rhs: Path) -> Bool {
return lhs.value == rhs.value
}
}
Is this considered okay, or is it bad form and it should really be defined:
struct Path: Equatable {
var value: String
static func ==(_ lhs: Path, _ rhs: Path) -> Bool {
return lhs.value == rhs.value
}
}
Both seem to work fine in practice… 🤔
Thank you!
Ray
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users