I have simple method in extension:
postfix operator |
extension Bool {
static postfix func |<T: Numeric> (p: Self) -> T {
p ? 1 : 0
}
}
But in Tests target is not possible to use this unary operator:
let intTrue: Double = true|
let intFalse: Int = false|
Error
'|' is not a prefix unary operator
I'm trying to convert library to SwiftPM: