subspace
subspace copied to clipboard
Use empty alignment bits of pointers to store Result state
For Dawn, a Result<ptr, ptr> can be stored in a single pointer (cc: @Kangz) when their values are known to never overlap.
While we can't hold two different newtype wrappers in the same storage, and drop the boolean. We can drop the E
storage if it can be held in the T
.
This is similar to Option representation but it requires two types, and they must share compatible storage. We may not need the types to opt in at all even, just compatible storage. To be constexpr we can't use reinterpret_cast, so for pointers they would need to be the same or related (static_cast).