[swift-evolution] Proposal: Compile-time parameters
2th at gmx.de
Sun Jan 31 07:55:51 CST 2016
>> Although integer-type parameters are most likely the only ones with a broad use case, any type implementing one of the ...LiteralCovertible protocols could be used. Enums and other entities could make sense as well, but this is beyond the scope of this proposal.
> Does this imply that only literals would be allowed?
For declaration: Yes, I think it is the simplest way to prevent confusion.
In the implementation, it should be possible to use compile-time parameters to instantiate new variants (like using a m x n matrix to generate a vector of size m * n, or creating a array of size 4 by adding a value to an array of size 3).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution