This patch adds the flip, set_range, and operator== functions to bitset.
These will be used in scanf.
Details
- Reviewers
sivachandra lntue - Commits
- rG374cebe8df08: [libc] add features to bitset
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please add unit-tests for the new methods.
libc/src/__support/CPP/bitset.h | ||
---|---|---|
40 | This method is not in std::bitset so we should not include it here. You can define a helper function in the other patch with the same functionality. |
libc/src/__support/CPP/bitset.h | ||
---|---|---|
40 | defining this function outside of the bitset class is less efficient because the internal Data array is private. I could implement it as a loop of calls to set but that would be masking one bit at a time. |
libc/src/__support/CPP/bitset.h | ||
---|---|---|
40 | Sigh, OK! Nevermind then. |
add unit tests and a "reset" function to support those tests. Also squash some bugs found with the tests.
This method is not in std::bitset so we should not include it here. You can define a helper function in the other patch with the same functionality.