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
#![feature(const_generics, specialization)]
#![allow(incomplete_features)]
#![deny(missing_docs)]
#![cfg_attr(not(test), no_std)]
mod add;
mod add_assign;
mod clone;
mod copy;
mod debug;
mod default;
mod deref;
mod div;
mod div_assign;
mod mul;
mod mul_assign;
mod partial_eq;
mod rem;
mod rem_assign;
mod sub;
mod sub_assign;
pub struct Vector<T = f32, const N: usize>([T; { N }]);
impl<T, const N: usize> Vector<T, { N }> {
pub fn new(components: [T; { N }]) -> Self {
components.into()
}
}
impl<T, const N: usize> From<[T; { N }]> for Vector<T, { N }> {
fn from(v: [T; { N }]) -> Self {
Self(v)
}
}