use std::{ self,
fmt::{self, Debug, Formatter},
ops, ptr,
};
pubuse bumpalo::collections::{String, Vec};
pubstructBox<'alloc, T: ?Sized>(&'alloc mut T);
impl<'alloc, T> Box<'alloc, T> { pubfn unbox(self) -> T { // This pointer read is safe because the reference `self.0` is // guaranteed to be unique--not just now, but we're guaranteed it's not // borrowed from some other reference. This in turn is because we never // construct an alloc::Box with a borrowed reference, only with a fresh // one just allocated from a Bump. unsafe { ptr::read(self.0as *mut T) }
}
}
impl<'alloc, T: ?Sized> ops::Deref for Box<'alloc, T> { type Target = T;
fn deref(&self) -> &T { self.0
}
}
impl<'alloc, T: ?Sized> ops::DerefMut for Box<'alloc, T> { fn deref_mut(&mutself) -> &mut T { self.0
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.