Q: Expressing associated type constraints

Hi! Quick question: I want something like this:

trait Foo {
    type Associated: ops::Add<f64,Output=f64>;
}

But also include the constraint f64:Add<Associated,Output=f64> for symmetry. Is there a syntax for doing this?

Thanks!

trait Foo
where
    f64: std::ops::Add<Self::Associated, Output = f64>,
{
    type Associated: std::ops::Add<f64, Output = f64>;
}
1 Like

Thanks!