#[doc(hidden)] #[macro_export(local_inner_macros)] macro_rules! impl_vector { () => { impl Vector{ pub const fn new(array:[T;N])->Self{ Self{array} } } impl Vector{ pub const fn from_value(value:T)->Self{ Self{ array:[value;N] } } } } } #[doc(hidden)] #[macro_export(local_inner_macros)] macro_rules! impl_vector_named_fields { ( $struct:ident, $size: expr ) => { impl core::ops::Deref for Vector<$size,T>{ type Target=$struct; fn deref(&self)->&Self::Target{ unsafe{core::mem::transmute(&self.array)} } } impl core::ops::DerefMut for Vector<$size,T>{ fn deref_mut(&mut self)->&mut Self::Target{ unsafe{core::mem::transmute(&mut self.array)} } } } }