Why size of Option is 8?
The Rust Programming Language Forum
Why size of Option is 8?
Hi folks! Why does the first line print 8? Also, the scond line prints 16, is that because Option contains two variants Some and None which is equivalent to containing two usize (discriminant)? fn main() { dbg!(size_of::<Option<&usize>>()); dbg!(size_of::<Option<usize>>()); }
0 comments
No comments yet.