zig
zig copied to clipboard
std: add decl literal initializers to some collections
For coherence, it would make sense if EnumMap, EnumSet, and EnumMultiset had .empty and .full decl literal initializers like other collections do.
I'm not sure if initEmpty() and initFull() should removed from these types completely, since decl literals seem to be the better way to do things now.
I'm not sure if
initEmpty()andinitFull()should removed from these types completely, since decl literals seem to be the better way to do things now.
I suggest implementing those old functions in terms of the new ones, and marking the old ones deprecated.
Done, thank you for the suggestion. I extended decl literals to StaticBitSet, as well.
Also, would it be good to squash these commits?
No need, I'll just squash when merging.
with the addition of of the decls, would it be a good opportunity to remove the default field values?
with the addition of of the decls, would it be a good opportunity to remove the default field values?
Since the default initializer for ArrayListUnmanaged is deprecated, I think that makes most sense. I'll go ahead with those changes and revert if needed.