Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Latest commit

 

History

History
28 lines (21 loc) · 720 Bytes

README.md

File metadata and controls

28 lines (21 loc) · 720 Bytes

CircularShwift

RIPEMD CircularShift Precedence Group ~<< Infix Operator in Swift 4.

was:

infix operator  ~<< { precedence 160 associativity none }

public func ~<< (lhs: UInt32, rhs: Int) -> UInt32 {
    return (lhs << UInt32(rhs)) | (lhs >> UInt32(32 - rhs));
}

is now:

precedencegroup CircularShwift {
    associativity: none
    higherThan: BitwiseShiftPrecedence
}

infix operator  ~<< : CircularShwift

public func ~<< (lhs: UInt32, rhs: Int) -> UInt32 {
    return (lhs << UInt32(rhs)) | (lhs >> UInt32(32 - rhs));
}

source: Swift-Evolution - Proposals - 0077-operator-precedence