This is a userlevel implementation of the undefined keyword in Zig.
It is inspired by MaybeUninit in Rust.
master
Each day will be tested in CI whether this project still builds on Zig master.
- 0.6.1
- Add
withByteas initializer function. - Remove all use of
inline, as the usage ofinlinewas considered wrong.
- Add
- 0.6
- Rename
assume_inittoassumeInit. - rename
as_ptrandas_mut_ptrtoasPtrandasMutPtr. - rename
first_ptrandfirst_ptr_muttofirstPtrandfirstPtrMut.
- Rename
- 0.5.2
- Only support Zig's Master branch.
- 0.5.1
- Add a private constant uninit intializer, to get around ziglang/zig#3994.
- 0.5
- Do not call
@memsetinMaybeUninit(T).zeroed()ifThas a size of 0.
- Do not call
- 0.4
- Prevent
MaybeUninit(noreturn)from being created. See ziglang/zig#3603.
- Prevent
- 0.3
- Change the return type of
first_ptr_mutfrom*Selfto*T. - Adds a test that calls
first_ptr_muton an empty slice.
- Change the return type of
- 0.2
- Change the definition of
MaybeUninitfrompacked uniontoextern union, due topacked union's setting the alignment always to 1.
- Change the definition of
- 0.1
- Initial library setup.
At the point of writing, it is impossible to create an uninitialized MaybeUninit(T), and later initialize it at compiletime.
This is an issue of the compiler, which tracks the current active field of packed and extern unions when used at compiletime, while it shouldn't.
The issue is reported to the Zig compiler, and can be followed here.