#[repr(C, packed)]
pub struct Array64<T>(pub [T; 64]);
impl<T> Array<T> for Array64<T>
{
const Size: usize = 64;
const Mask: usize = 64 - 1;
#[inline(always)]
unsafe fn get_unchecked(&self, index: usize) -> &T
{
self.0.get_unchecked(index)
}
#[inline(always)]
unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T
{
self.0.get_unchecked_mut(index)
}
#[inline(always)]
fn as_ptr(&self) -> *const T
{
self.0.as_ptr()
}
#[inline(always)]
fn as_mut_ptr(&mut self) -> *mut T
{
self.0.as_mut_ptr()
}
}
impl<T: Copy> Copy for Array64<T>
{
}
impl<T: Copy> Clone for Array64<T>
{
#[inline(always)]
fn clone(&self) -> Self
{
Array64(self.0)
}
}
impl<T: Debug> Debug for Array64<T>
{
#[inline(always)]
fn fmt(&self, formatter: &mut Formatter) -> Result
{
self.0[..].fmt(formatter)
}
}
impl<T: PartialEq> PartialEq for Array64<T>
{
#[inline(always)]
fn eq(&self, other: &Array64<T>) -> bool
{
self.0[..].eq(&other.0[..])
}
}
impl<T: Eq> Eq for Array64<T>
{
}
impl<T: PartialOrd> PartialOrd for Array64<T>
{
#[inline(always)]
fn partial_cmp(&self, other: &Array64<T>) -> Option<Ordering>
{
PartialOrd::partial_cmp(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn lt(&self, other: &Array64<T>) -> bool
{
PartialOrd::lt(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn le(&self, other: &Array64<T>) -> bool
{
PartialOrd::le(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn ge(&self, other: &Array64<T>) -> bool
{
PartialOrd::ge(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn gt(&self, other: &Array64<T>) -> bool
{
PartialOrd::gt(&&self.0[..], &&other.0[..])
}
}
impl<T: Ord> Ord for Array64<T>
{
#[inline(always)]
fn cmp(&self, other: &Array64<T>) -> Ordering
{
Ord::cmp(&&self.0[..], &&other.0[..])
}
}
impl<T: Hash> Hash for Array64<T>
{
#[inline(always)]
fn hash<H: Hasher>(&self, state: &mut H)
{
Hash::hash(&self.0[..], state)
}
}
impl<'a, T> IntoIterator for &'a Array64<T>
{
type Item = &'a T;
type IntoIter = Iter<'a, T>;
#[inline(always)]
fn into_iter(self) -> Iter<'a, T>
{
self.0.iter()
}
}
impl<'a, T> IntoIterator for &'a mut Array64<T>
{
type Item = &'a mut T;
type IntoIter = IterMut<'a, T>;
#[inline(always)]
fn into_iter(self) -> IterMut<'a, T>
{
self.0.iter_mut()
}
}
impl<T> AsRef<[T]> for Array64<T>
{
#[inline(always)]
fn as_ref(&self) -> &[T]
{
&self.0[..]
}
}
impl<T> AsMut<[T]> for Array64<T>
{
#[inline(always)]
fn as_mut(&mut self) -> &mut [T]
{
&mut self.0[..]
}
}