mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 15:08:20 +00:00
[Swift] Implements FlatbuffersVector which confirms to RandomAccessCollection (#8752)
* Implements FlatbuffersVector in swift Implements FlatbuffersVector which confirms to RandomAccessCollection, this would give us semi-native sugary syntax to all the arrays in swift port. This work will also be the foundation of using arrays in swift * Fix failing tests for Swift
This commit is contained in:
@@ -39,14 +39,13 @@ public protocol FlexBufferContiguousBytes {
|
||||
var count: Int { get }
|
||||
|
||||
func withUnsafeRawBufferPointer<Result>(
|
||||
_ body: (UnsafeRawBufferPointer) throws -> Result
|
||||
) rethrows -> Result
|
||||
_ body: (UnsafeRawBufferPointer) throws -> Result) rethrows -> Result
|
||||
}
|
||||
|
||||
extension FlexBufferContiguousBytes {
|
||||
public func withUnsafeRawBufferPointer<Result>(
|
||||
_ body: (UnsafeRawBufferPointer) throws -> Result
|
||||
) rethrows -> Result {
|
||||
_ body: (UnsafeRawBufferPointer) throws -> Result) rethrows -> Result
|
||||
{
|
||||
try byteBuffer.withUnsafePointerToSlice(
|
||||
index: offset,
|
||||
count: count,
|
||||
|
||||
Reference in New Issue
Block a user