Function nstd_sys::vec::nstd_vec_reserved
source · #[no_mangle]
pub const extern "C" fn nstd_vec_reserved(
vec: &NSTDVec<'_>
) -> NSTDUIntAvailable on crate feature
vec only.Expand description
Returns the number of reserved elements within a vector’s inactive buffer.
Parameters:
const NSTDVec *vec- The vector.
Returns
NSTDUInt reserved - The number of uninitialized elements within vec’s inactive buffer.
Example
use nstd_sys::{
alloc::NSTD_ALLOCATOR,
vec::{nstd_vec_new_with_cap, nstd_vec_reserved},
};
unsafe {
let vec = nstd_vec_new_with_cap(&NSTD_ALLOCATOR, 2, 16).unwrap();
assert!(nstd_vec_reserved(&vec) == 16);
}