macro_rules! soa { () => { ... }; ($x:expr $(,$xs:expr)* $(,)?) => { ... }; ($elem:expr; 0) => { ... }; ($elem:expr; 1) => { ... }; ($elem:expr; $n:expr) => { ... }; }
Expand description
Creates a Soa containing the arguments.
soa! allows Soas to be defined with the same syntax as array
expressions. There are two forms of this macro:
- Create a
Soacontaining a given list of elements:
let soa = soa![Foo(1, 2), Foo(3, 4)];
assert_eq!(soa, soa![Foo(1, 2), Foo(3, 4)]);- Create a
Soafrom a given element and size:
let soa = soa![Foo(1, 2); 2];
assert_eq!(soa, soa![Foo(1, 2), Foo(1, 2)]);