mirror of
https://github.com/apple/swift-numerics
synced 2026-11-22 04:30:45 +00:00
20 lines
698 B
Swift
20 lines
698 B
Swift
//===--- Complex+IntegerLiteral.swift -------------------------*- swift -*-===//
|
|
//
|
|
// This source file is part of the Swift Numerics open source project
|
|
//
|
|
// Copyright (c) 2019 - 2021 Apple Inc. and the Swift Numerics project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
extension Complex: ExpressibleByIntegerLiteral {
|
|
public typealias IntegerLiteralType = RealType.IntegerLiteralType
|
|
|
|
@inlinable
|
|
public init(integerLiteral value: IntegerLiteralType) {
|
|
self.init(RealType(integerLiteral: value))
|
|
}
|
|
}
|