japaric-archived / linalg.rs

[INACTIVE]
Apache License 2.0
29 stars 1 forks source link

`col_a == col_b` and `col_a == scalar` should work #70

Open japaric opened 9 years ago

japaric commented 9 years ago

This can't be done right now because I get a "conflicting implementations" error:

impl<'a, 'b, A, B> PartialEq<Col<'a, A>> for Col<'b, B> where B: PartialEq<B> {
    ..
}

impl<'b, A, B> PartialEq<A> for Col<'b, B> where B: PartialEq<B> {
    ..
}

(A could be Col<'_, _>)

This can be solved with unsized types:

// Col is unsized

impl<A, B> PartialEq<Col<A>> for Col<B> where B: PartialEq<B> {
    ..
}

impl<A: Sized, B> PartialEq<A> for Col<B> where B: PartialEq<B> {
    ..
}

Blocked on user defined unsized types