pub trait MutableTPointer<T>
{
#[inline(always)]
fn write(self, source: T);
#[inline(always)]
fn swap(self, source: *mut T);
}
impl<T> MutableTPointer<T> for *mut T
{
#[inline(always)]
fn write(self, source: T)
{
debug_assert!(!self.is_null(), "self is a null pointer");
unsafe { write(self, source) }
}
#[inline(always)]
fn swap(self, source: *mut T)
{
debug_assert!(!self.is_null(), "self is a null pointer");
debug_assert!(!source.is_null(), "destination is a null pointer");
unsafe { swap(self, source) };
}
}