pub struct Triangle<T: Float + std::clone::Clone, V: vector::Vector<T>> {
point1: V,
point2: V,
point3: V,
}
This chunck of code doesn't compile because T isn't used (Nevertheless, T is used later in a method)
I have tried this syntax
pub struct Triangle<V: vector::Vector<T: Float + std::clone::Clone>> {
point1: V,
point2: V,
point3: V,
}
Error:
expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `:`
expected one of 7 possible tokens here
and this syntax
pub struct Triangle2<V> where V: vector::Vector<T> where T: Float {
point1: V,
point2: V,
point3: V,
}
Error:
expected `where`, or `{` after struct name, found keyword `where`
expected `where`, or `{` after struct name
that doesn't work.
Is there a way to fix this problem?