[swift-evolution] [Review] SE-0104: Protocol-oriented integers

Stephen Canon scanon at apple.com
Thu Jun 23 11:28:26 CDT 2016

On Jun 23, 2016, at 2:23 AM, Félix Cloutier via swift-evolution <swift-evolution at swift.org> wrote:

> Is there a way to get an optional initializer that returns `nil` if the operand can't be represented?

That’s in the Arithmetic Protocol in the proposal:

/// Initializes to the value of `source` if it is representable exactly,
/// returns `nil` otherwise.
init?<T : Integer>(exactly source: T)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160623/5bf8ff4c/attachment.html>

More information about the swift-evolution mailing list