Type soa and conversion from existing data structure

This commit is contained in:
Folkert 2022-10-21 13:11:47 +02:00 committed by Ayaz Hafiz
parent 9abed3472a
commit 93b9130edf
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 512 additions and 14 deletions

View file

@ -1,11 +1,24 @@
use std::usize;
#[derive(PartialEq, Eq)]
pub struct Index<T> {
index: u32,
_marker: std::marker::PhantomData<T>,
}
impl<T> Eq for Index<T> {}
impl<T> PartialEq for Index<T> {
fn eq(&self, other: &Self) -> bool {
self.index == other.index
}
}
impl<T> std::hash::Hash for Index<T> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.index.hash(state);
}
}
impl<T> Clone for Index<T> {
fn clone(&self) -> Self {
Self {