pub fn initCapacity(gpa: Allocator, num: usize) Allocator.Error!Self
Initialize with capacity to hold exactly num elements. Deinitialize with deinit or toOwnedSlice.
num
deinit
toOwnedSlice
gpa: Allocator
num: usize
38 39 40 41 42
pub fn initCapacity(gpa: Allocator, num: usize) Allocator.Error!Self { var self: Self = .empty; try self.setCapacity(gpa, num); return self; }
Initialize with capacity to hold exactly
numelements. Deinitialize withdeinitortoOwnedSlice.