From 29b46e75827bf7c4a017ccc6a8bae8a57db3e552 Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Fri, 30 Dec 2016 23:02:58 +0300 Subject: [PATCH] Added various unsinged integer operators overloads. --- Sources/Extensions.swift | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/Sources/Extensions.swift b/Sources/Extensions.swift index fed2aea1..e8649740 100644 --- a/Sources/Extensions.swift +++ b/Sources/Extensions.swift @@ -46,3 +46,52 @@ extension Int { } } + +func +(lhs: UInt8, rhs: UInt16) -> UInt16 { + return UInt16(lhs) + rhs +} + +func +(lhs: UInt16, rhs: UInt8) -> UInt16 { + return lhs + UInt16(rhs) +} + +func +(lhs: UInt8, rhs: UInt32) -> UInt32 { + return UInt32(lhs) + rhs +} + +func +(lhs: UInt32, rhs: UInt8) -> UInt32 { + return lhs + UInt32(rhs) +} + +func +(lhs: UInt8, rhs: UInt64) -> UInt64 { + return UInt64(lhs) + rhs +} + +func +(lhs: UInt64, rhs: UInt8) -> UInt64 { + return lhs + UInt64(rhs) +} + +func +(lhs: UInt16, rhs: UInt32) -> UInt32 { + return UInt32(lhs) + rhs +} + +func +(lhs: UInt32, rhs: UInt16) -> UInt32 { + return lhs + UInt32(rhs) +} + +func +(lhs: UInt16, rhs: UInt64) -> UInt64 { + return UInt64(lhs) + rhs +} + +func +(lhs: UInt64, rhs: UInt16) -> UInt64 { + return lhs + UInt64(rhs) +} + +func +(lhs: UInt32, rhs: UInt64) -> UInt64 { + return UInt64(lhs) + rhs +} + +func +(lhs: UInt64, rhs: UInt32) -> UInt64 { + return lhs + UInt64(rhs) +} +