DoxigAlpha

add

Insert a new element, maintaining priority.

Function parameters

Parameters

#
self:*Self
elem:T

Priority queue for storing generic data.

Functions

#
PriorityQueue
Priority queue for storing generic data.

Source

Implementation

#
pub fn add(self: *Self, elem: T) !void {
    try self.ensureUnusedCapacity(1);
    addUnchecked(self, elem);
}