Add allocator function

This commit is contained in:
yanchith 2023-06-09 11:53:28 +02:00
parent 7a9f282528
commit 208da513cc

View File

@ -1245,6 +1245,13 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
self.into()
}
/// Returns a reference to the underlying allocator.
#[unstable(feature = "allocator_api", issue = "32838")]
#[inline]
pub fn allocator(&self) -> &A {
self.data.allocator()
}
/// Returns the length of the binary heap.
///
/// # Examples