mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
17 lines
291 B
Swift
17 lines
291 B
Swift
@public struct SpecialInt {
|
|
@public var value = 0
|
|
@public init() {}
|
|
}
|
|
|
|
operator prefix +++ {}
|
|
operator postfix +++ {}
|
|
|
|
@prefix @public func +++(inout base: SpecialInt) {
|
|
base.value += 2
|
|
}
|
|
|
|
@postfix @public func +++(inout base: SpecialInt) {
|
|
println("use the prefix form instead")
|
|
}
|
|
|