Skip to content

Commit

Permalink
Remove SimdVisitorWithContext default trait implementation
Browse files Browse the repository at this point in the history
Removed because `SimdVisitor`'s default implementation causes issues.
It will be automatically implemented for types that may want to implement
`SimdVisitorWithContext` and thus cause them to automatically implement
the default trait implementation. Since there can only be one
trait implementation per type, this effectively prevents the use
of the new trait.
  • Loading branch information
Makogan (Makogan) committed Apr 25, 2024
1 parent c2b1586 commit a0f465b
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/partitioning/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,6 @@ pub trait SimdVisitorWithContext<LeafData, SimdBV, Context: Clone> {
) -> (SimdVisitStatus, [Context; SIMD_WIDTH]);
}

impl<T, LeafData, SimdBV, Context: Clone> SimdVisitorWithContext<LeafData, SimdBV, Context> for T
where
T: SimdVisitor<LeafData, SimdBV>,
{
fn visit(
&mut self,
bv: &SimdBV,
data: Option<[Option<&LeafData>; SIMD_WIDTH]>,
context: Context,
) -> (SimdVisitStatus, [Context; SIMD_WIDTH]) {
let contexts = std::array::from_fn(|_| context.clone());
(self.visit(bv, data), contexts)
}
}

/// Trait implemented by visitor called during a simultaneous spatial partitioning data structure tarversal.
pub trait SimdSimultaneousVisitor<T1, T2, SimdBV> {
/// Execute an operation on the content of two nodes, one from each structure.
Expand Down

0 comments on commit a0f465b

Please sign in to comment.