<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Jun 23, 2016, at 2:23 AM, Félix Cloutier via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><div><div class=""><br class="Apple-interchange-newline"></div><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Is there a way to get an optional initializer that returns `nil` if the operand can't be represented?</span></div></blockquote></div><br class=""><div class="">That’s in the Arithmetic Protocol in the proposal:</div><div class=""><br class=""></div><div class=""><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; color: rgb(51, 51, 51);" class=""><span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">/// Initializes to the value of `source` if it is representable exactly,</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">/// returns `nil` otherwise.</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">init</span>?<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);"><</span>T <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">:</span> Integer<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">></span>(exactly source: T)</pre><div class=""><br class=""></div></div></body></html>