1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#[repr(C, packed)]
pub struct Array1024<T>(pub [T; 1024]);
impl<T> Array<T> for Array1024<T>
{
const Size: usize = 1024;
const Mask: usize = 1024 - 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)
}
}
impl<T: Copy> Copy for Array1024<T>
{
}
impl<T: Copy> Clone for Array1024<T>
{
#[inline(always)]
fn clone(&self) -> Self
{
Array1024(self.0)
}
}
impl<T: Debug> Debug for Array1024<T>
{
#[inline(always)]
fn fmt(&self, formatter: &mut Formatter) -> Result
{
self.0[..].fmt(formatter)
}
}
impl<T: PartialEq> PartialEq for Array1024<T>
{
#[inline(always)]
fn eq(&self, other: &Array1024<T>) -> bool
{
self.0[..].eq(&other.0[..])
}
}
impl<T: Eq> Eq for Array1024<T>
{
}
impl<T: PartialOrd> PartialOrd for Array1024<T>
{
#[inline(always)]
fn partial_cmp(&self, other: &Array1024<T>) -> Option<Ordering>
{
PartialOrd::partial_cmp(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn lt(&self, other: &Array1024<T>) -> bool
{
PartialOrd::lt(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn le(&self, other: &Array1024<T>) -> bool
{
PartialOrd::le(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn ge(&self, other: &Array1024<T>) -> bool
{
PartialOrd::ge(&&self.0[..], &&other.0[..])
}
#[inline(always)]
fn gt(&self, other: &Array1024<T>) -> bool
{
PartialOrd::gt(&&self.0[..], &&other.0[..])
}
}
impl<T: Ord> Ord for Array1024<T>
{
#[inline(always)]
fn cmp(&self, other: &Array1024<T>) -> Ordering
{
Ord::cmp(&&self.0[..], &&other.0[..])
}
}
impl<T: Hash> Hash for Array1024<T>
{
#[inline(always)]
fn hash<H: Hasher>(&self, state: &mut H)
{
Hash::hash(&self.0[..], state)
}
}
impl<'a, T> IntoIterator for &'a Array1024<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 Array1024<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 Array1024<T>
{
#[inline(always)]
fn as_ref(&self) -> &[T]
{
&self.0[..]
}
}
impl<T> AsMut<[T]> for Array1024<T>
{
#[inline(always)]
fn as_mut(&mut self) -> &mut [T]
{
&mut self.0[..]
}
}