more generic Neg operator

This commit is contained in:
Quaternions 2024-09-05 15:56:35 -07:00
parent f4d28dd3c3
commit 345d5737a2

View File

@ -92,10 +92,10 @@ macro_rules! impl_vector {
} }
} }
impl<const N:usize,T:core::ops::Neg<Output=T>> core::ops::Neg for Vector<N,T>{ impl<const N:usize,T:core::ops::Neg<Output=V>,V> core::ops::Neg for Vector<N,T>{
type Output=Self; type Output=Vector<N,V>;
fn neg(self)->Self::Output{ fn neg(self)->Self::Output{
Self{ Vector{
array:self.array.map(|t|-t) array:self.array.map(|t|-t)
} }
} }