I have the following code:
const N: usize = 10000;
const S: usize = 7000;
#[derive(Copy, Clone, Debug)]
struct T {
a: f64,
b: f64,
f: f64
}
fn main
You can use std::mem::uninitialized(). Note, however, that it is considered unsafe and needs to be marked as such:
let mut t: [T; N] = unsafe { std::mem::uninitialized() };
As stated by the aforelinked docs:
This is useful for FFI functions and initializing arrays sometimes, but should generally be avoided.