use std::ops::{Deref, DerefMut}; use std::mem; use alga::general::Real; use core::coordinates::IJKW; use core::storage::OwnedStorage; use core::allocator::OwnedAllocator; use core::dimension::{U1, U4}; use geometry::QuaternionBase; impl Deref for QuaternionBase where N: Real, S: OwnedStorage, S::Alloc: OwnedAllocator { type Target = IJKW; #[inline] fn deref(&self) -> &Self::Target { unsafe { mem::transmute(self) } } } impl DerefMut for QuaternionBase where N: Real, S: OwnedStorage, S::Alloc: OwnedAllocator { #[inline] fn deref_mut(&mut self) -> &mut Self::Target { unsafe { mem::transmute(self) } } }