Vector, a fixed-size array

This has been proposed and discussed extensively in the past few years. In practice it runs up against some pretty hard limits, some of which have already been discussed up-thread:

  • Tuples are non-nominal types, so there's no way to conform them to, say Collection.
  • Tuple conformances can only express the special case of a tuple that conforms to a protocol because all of its elements do.
  • The ABI mangling for tuples is pretty awful when it comes to using them as a fixed-size container.
  • We have no good mechanism for talking about large homogeneous tuples in the language.
  • Plumbing initialization through tuples is kind of a mess.
  • Also there's a layout issue about tail padding.
  • and some other stuff

All of these are probably solvable, but by the time you do so, you're really talking about a separate non-tuple type. So it makes more sense to just build that type directly.

That is exactly what this proposal is doing.

10 Likes