more generic Neg operator
This commit is contained in:
parent
f4d28dd3c3
commit
345d5737a2
@ -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>{
|
||||
type Output=Self;
|
||||
impl<const N:usize,T:core::ops::Neg<Output=V>,V> core::ops::Neg for Vector<N,T>{
|
||||
type Output=Vector<N,V>;
|
||||
fn neg(self)->Self::Output{
|
||||
Self{
|
||||
Vector{
|
||||
array:self.array.map(|t|-t)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user