Skip to content

Instantly share code, notes, and snippets.

@maximkrouk
Last active June 3, 2020 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximkrouk/dd553dcecdabe3df2c988e7b3532d4fa to your computer and use it in GitHub Desktop.
Save maximkrouk/dd553dcecdabe3df2c988e7b3532d4fa to your computer and use it in GitHub Desktop.
extension <#Box#>: ExpressibleByNilLiteral where Content: ExpressibleByNilLiteral {
@inlinable
public convenience init(nilLiteral: Void) { self.init(nilLiteral: nilLiteral) }
}
extension <#Box#>: ExpressibleByFloatLiteral where Content: ExpressibleByFloatLiteral {
@inlinable
public convenience init(floatLiteral value: Content.FloatLiteralType) {
self.init(.init(floatLiteral: value))
}
}
extension <#Box#>: ExpressibleByIntegerLiteral where Content: ExpressibleByIntegerLiteral {
@inlinable
public convenience init(integerLiteral value: Content.IntegerLiteralType) {
self.init(Content(integerLiteral: value))
}
}
extension <#Box#>: ExpressibleByBooleanLiteral where Content: ExpressibleByBooleanLiteral {
@inlinable
public convenience init(booleanLiteral value: Content.BooleanLiteralType) {
self.init(Content(booleanLiteral: value))
}
}
extension <#Box#>: ExpressibleByExtendedGraphemeClusterLiteral where Content: ExpressibleByExtendedGraphemeClusterLiteral {
@inlinable
public convenience init(extendedGraphemeClusterLiteral value: Content.ExtendedGraphemeClusterLiteralType) {
self.init(Content(extendedGraphemeClusterLiteral: value))
}
}
extension <#Box#>: ExpressibleByUnicodeScalarLiteral where Content: ExpressibleByUnicodeScalarLiteral {
@inlinable
public convenience init(unicodeScalarLiteral value: Content.UnicodeScalarLiteralType) {
self.init(Content(unicodeScalarLiteral: value))
}
}
extension <#Box#>: ExpressibleByStringLiteral where Content: ExpressibleByStringLiteral {
@inlinable
public convenience init(stringLiteral value: Content.StringLiteralType) {
self.init(Content(stringLiteral: value))
}
}
extension <#Box#> where Content: ExpressibleByArrayLiteral {
@inlinable
public convenience init() { self.init([]) }
}
extension <#Box#> where Content: ExpressibleByDictionaryLiteral {
@inlinable
public convenience init() { self.init([:]) }
}
extension <#Box#> where Content: ExpressibleByStringLiteral {
@inlinable
public convenience init() { self.init("") }
}
extension <#Box#>: ExpressibleByNilLiteral where Content: ExpressibleByNilLiteral {
@inlinable
public init(nilLiteral: Void) { self.init(nilLiteral: nilLiteral) }
}
extension <#Box#>: ExpressibleByFloatLiteral where Content: ExpressibleByFloatLiteral {
@inlinable
public init(floatLiteral value: Content.FloatLiteralType) {
self.init(.init(floatLiteral: value))
}
}
extension <#Box#>: ExpressibleByIntegerLiteral where Content: ExpressibleByIntegerLiteral {
@inlinable
public init(integerLiteral value: Content.IntegerLiteralType) {
self.init(Content(integerLiteral: value))
}
}
extension <#Box#>: ExpressibleByBooleanLiteral where Content: ExpressibleByBooleanLiteral {
@inlinable
public init(booleanLiteral value: Content.BooleanLiteralType) {
self.init(Content(booleanLiteral: value))
}
}
extension <#Box#>: ExpressibleByExtendedGraphemeClusterLiteral where Content: ExpressibleByExtendedGraphemeClusterLiteral {
@inlinable
public init(extendedGraphemeClusterLiteral value: Content.ExtendedGraphemeClusterLiteralType) {
self.init(Content(extendedGraphemeClusterLiteral: value))
}
}
extension <#Box#>: ExpressibleByUnicodeScalarLiteral where Content: ExpressibleByUnicodeScalarLiteral {
@inlinable
public init(unicodeScalarLiteral value: Content.UnicodeScalarLiteralType) {
self.init(Content(unicodeScalarLiteral: value))
}
}
extension <#Box#>: ExpressibleByStringLiteral where Content: ExpressibleByStringLiteral {
@inlinable
public init(stringLiteral value: Content.StringLiteralType) {
self.init(Content(stringLiteral: value))
}
}
extension <#Box#> where Content: ExpressibleByArrayLiteral {
@inlinable
public init() { self.init([]) }
}
extension <#Box#> where Content: ExpressibleByDictionaryLiteral {
@inlinable
public init() { self.init([:]) }
}
extension <#Box#> where Content: ExpressibleByStringLiteral {
@inlinable
public init() { self.init("") }
}
@maximkrouk
Copy link
Author

maximkrouk commented May 30, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment