max(_:_:) and min(_:_:) in an Int extension in Swift

Viewed 503

Why are max(::) and min(::) not allowed in a Swift Int extension, such as:

extension Int {
    func some(low: Int, high: Int) -> Int {
        return max(low, high)
    }
}

The error says: Static member 'max' cannot be used on instance of type'Int'

1 Answers
Related