what size should an empty object be?
theSherwood opened this issue · comments
Should empty objects be of size 0
? Maybe in some contexts that won't even work.
Example
type
Empty = object
Wrapper*[K, V] = object
node*: (K, V)
echo sizeof(Empty)
echo sizeof(Wrapper[uint8, Empty])
Actual Output
1
2
Expected Output
0
1
Possible Solution
Additional Information
References
It's possible to implement empty objects/tuples/arrays having a size of 0, but I personally don't think it's worth the added compiler/language complexity.