trait constructor doesn't work because trait bounds (and is also bad)

This commit is contained in:
Quaternions 2024-08-28 09:06:16 -07:00
parent c43fab2f18
commit 4ae391e9fd

View File

@ -3,8 +3,8 @@ pub struct Ratio<Num,Den>{
pub(crate)num:Num, pub(crate)num:Num,
pub(crate)den:Den, pub(crate)den:Den,
} }
//this trait is like a constructor for Ratio impl<Num,Den> Ratio<Num,Den>{
pub trait DeferredDiv<Rhs=Self>{ pub const fn new(num:Num,den:Den)->Self{
type Output; Self{num,den}
fn deferred_div(self,rhs:Rhs)->Self::Output; }
} }