Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FixedBitSet to provide constexpr storage for EnumSet #174

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rgb2hsv
Copy link

@rgb2hsv rgb2hsv commented Nov 25, 2024

EnumSet currently uses std::array as the backing type because std::bitset is not sufficiently constexpr. This PR introduces FixedBitSet as a possible solution. The overall advantage is that EnumSet can then be extended to incorporate addition += deletion -= and contains(EnumSet<>) operations for subsets.

}

public:
_Ty _Data[_Words + 1];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be public to satisfy IsStructuralType() requirement. std::array has a similar quirk of making __elems_[N] public.

@alexkaratarakis
Copy link
Collaborator

Relevant discussion: #156
I have been working on a FixedBitSet implementation, was not aware of this one. Let me do a more thorough review when time permits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants