This commit is contained in:
Quaternions 2024-09-05 13:52:54 -07:00
parent e026f6efed
commit 56b781fcb8
2 changed files with 17 additions and 2 deletions

View File

@ -2,7 +2,11 @@
#[macro_export(local_inner_macros)] #[macro_export(local_inner_macros)]
macro_rules! impl_matrix { macro_rules! impl_matrix {
() => { () => {
//$crate::impl_common!(); impl<const X:usize,const Y:usize,T> Matrix<X,Y,T>{
pub const fn new(array:[[T;Y];X])->Self{
Self{array}
}
}
} }
} }

View File

@ -2,7 +2,18 @@
#[macro_export(local_inner_macros)] #[macro_export(local_inner_macros)]
macro_rules! impl_vector { macro_rules! impl_vector {
() => { () => {
//$crate::impl_common!(); impl<const N:usize,T> Vector<N,T>{
pub const fn new(array:[T;N])->Self{
Self{array}
}
}
impl<const N:usize,T:Copy> Vector<N,T>{
pub const fn from_value(value:T)->Self{
Self{
array:[value;N]
}
}
}
} }
} }