Macro if_alloc

Source
macro_rules! if_alloc {
    ($($tt:tt)*) => { ... };
}
Expand description

Conditional compilation depending on whether arraylib is built with alloc feature.

This macro is needed if you want to implement Array on your type (change your mind, you fool) which requires into_boxed_slice method, but only if alloc feature is enabled.

When arraylib is built with alloc feature, this macro expands transparently into just the input tokens.

macro_rules! if_alloc {
    ($($tt:tt)*) => {
        $($tt)*
    };
}

When built without alloc feature, this macro expands to nothing.

macro_rules! if_alloc {
    ($($tt:tt)*) => {};
}