Macro hk_array

Source
macro_rules! hk_array {
    () => { ... };
    ($value:expr; $count:expr) => { ... };
    ($($elem:expr),+ $(,)?) => { ... };
    (with_allocator: $alloc:ty => $value:expr; $count:expr) => { ... };
    (with_allocator: $alloc:ty => $($elem:expr),+ $(,)?) => { ... };
}
Expand description

A macro to construct an hkArrayBase similar to the vec![] macro.

ยงExamples

Create an array with values:

let arr = hk_array![1, 2, 3];

Create an empty array:

use commonlibsse_ng::re::hkArray::hkArray;
let empty: hkArray<i8> = hk_array![];

Create an array with a custom allocator:

use stdx::alloc::Global;
let arr = hk_array![with_allocator: Global => "a", "b", "c"];