imumCapacity: Int,
initWith factory: (StorageClass) throws -> ()
) rethrows {
buffer = Builtin.allocWithTailElems_1(
StorageClass.self, minimumCapacity._builtinWordValue, Element.self)
try factory(buffer)
}
// ...
let buffer: StorageClass
}
>
>
>> On Oct
ved from, e.g., NSString or NSArray. That is,
> however, an extremely stdlib-specifc need.
>
>
>>> On 2016-10-11, at 00:12, Erik Eckstein via swift-evolution
>> <swift-evolution@swift.org> wrote:
>>>
>>> The purpose of ManagedBufferPointer is to create a buffer w
The purpose of ManagedBufferPointer is to create a buffer with a custom
class-metadata to be able to implement a custom deinit (e.g. to destroy the
tail allocated elements).
It was used in Array (before I replaced it with the new
tail-allocated-array-built-ins). But now it’s not used anymore in
> This is now part of a pull - https://github.com/apple/swift-evolution/pull/437
>
> The discussion for the four items in the pull ran here
> (http://thread.gmane.org/gmane.comp.lang.swift.evolution/23093), though there
> was not enough feedback. But given the deadline for breaking changes, I
The reason why `ManagedProtoBuffer` (the base class of `ManagedBuffer`) exists
is to give the users an extra bit of type safety inside of the closure
`initialHeader` passed to `ManagedBuffer.create()`.
public class ManagedBuffer