Re: [swift-evolution] Proposal Sketch: Bring flexible array members in as Array|UnsafeReference

2015-12-22 Thread Félix Cloutier via swift-evolution
In general, I find that importing C arrays is problematic. I don't have any nice solution to offer, though. For now, you might be able to get away with withUnsafePointer() { ... }. Félix > Le 22 déc. 2015 à 17:29:10, T.J. Usiyan via swift-evolution > a écrit : >

Re: [swift-evolution] Proposal Sketch: Bring flexible array members in as Array|UnsafeReference

2015-12-22 Thread Dmitri Gribenko via swift-evolution
On Tue, Dec 22, 2015 at 2:29 PM, T.J. Usiyan via swift-evolution < swift-evolution@swift.org> wrote: > MIDIMetaEvent and MIDIEventUserData are both examples of framework > provided types which rely on flexible member arrays. Their last member is > (officially) an array of UInt8 with 1 element. In

[swift-evolution] Proposal Sketch: Bring flexible array members in as Array|UnsafeReference

2015-12-22 Thread T.J. Usiyan via swift-evolution
MIDIMetaEvent and MIDIEventUserData are both examples of framework provided types which rely on flexible member arrays. Their last member is (officially) an array of UInt8 with 1 element. In practice, developers are meant to allocate enough space for an array of the necessary length along with the