1 unstable release
0.1.0 | Mar 29, 2024 |
---|
#35 in #fn
39 downloads per month
Used in dib
7KB
91 lines
car
macro based array manipulation constant techniques
you wanted a quick LUT in const? here you go!
// please note that this is in no way performant or a good idea.
let squares: [usize; 0xffffffff] = car::from_fn!(|i| i * 2);
completely stable!
for once!
lib.rs
:
provides some (map
and from_fn
) core::array
fn related functions as const macros.
const X: [usize; 6] = car::map!(car::from_fn!(|x| x), |x| x * 24);
Dependencies
~310–760KB
~18K SLoC