<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=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""></pre>FWIW, I think most of the time it’s actually better to extend SequenceType rather than Array. I can’t think of many cases (for common code I would write), where an extension would be solely applicable to the Array type, and not all sequences (i.e. also array slices, etc.)<br class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">I would love to see this feature if it is possible. You can’t currently create an extension on Array<Double> so a common work-around is to add your functionality to SequenceType where you constrain the Generator’s Element to be of type Double - this means I’ve added functionality in places beyond where it belongs.
Daniel
><i class=""> On Dec 7, 2015, at 6:40 AM, Tuur Anton via swift-evolution <<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">swift-evolution at swift.org</a>> wrote:
</i>><i class="">
</i>><i class=""> Can you please add these features in Swift 3?
</i>><i class="">
</i>><i class=""> 1. The ability to do this:
</i>><i class=""> extension Array<Double> {
</i>><i class=""> //extend arrays of doubles
</i>><i class=""> }
</i>><i class=""> </i></pre></blockquote><div class=""><br class=""></div><br class=""><br class=""><div class="">
<div class="">— Radek</div>
</div>
<br class=""></body></html>