> On 15 Feb 2017, at 18:51, Daryle Walker via swift-evolution 
> <[email protected]> wrote:
> 
> I don't know how protocol support works. I asking because I want to maintain 
> the stride of an array being the total count times the stride of the element, 
> which would complicate nominal arrays if adding protocols to one breaks that. 
> 
> Sent from my iPhone
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

The stride of an Array<T> is the width of a pointer, since Arrays are stored 
indirectly. Also, the allocated capacity may be greater than the number of 
elements actually contained in the Array. If you want a fixed-size group of 
elements, with a stride equal to the number of elements multiplied by the 
per-element stride, use a tuple.

- Karl
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to