fn toOwnedSliceSentinel(self: *Self, allocator: Allocator, comptime sentinel: T) Allocator.Error!SentinelSlice(sentinel)

The caller owns the returned memory. ArrayList becomes empty.

Parameters

self: *Self,
allocator: Allocator,
sentinel: T,