Files
bitcoin/src
Ava Chow 91e0beede2 Merge bitcoin/bitcoin#30160: util: add BitSet
47f705b33f tests: add fuzz tests for BitSet (Pieter Wuille)
59a6df6bd5 util: add BitSet (Pieter Wuille)

Pull request description:

  Extracted from #30126.

  This introduces the `BitSet` data structure, inspired by `std::bitset`, but with a few features that cannot be implemented on top without efficiency loss:
  * Finding the first set bit (`First`)
  * Finding the last set bit (`Last`)
  * Iterating over all set bits (`begin` and `end`).

  And a few other operators/member functions that help readability for #30126:
  * `operator-` for set subtraction
  * `Overlaps()` for testing whether intersection is non-empty
  * `IsSupersetOf()` for testing (non-strict) supersetness
  * `IsSubsetOf()` for testing (non-strict) subsetness
  * `Fill()` to construct a set with all numbers from 0 to n-1, inclusive
  * `Singleton()` to construct a set with one specific element.

  Everything is tested through a simulation-based fuzz test that compares the behavior with normal `std::bitset` equivalent operations.

ACKs for top commit:
  instagibbs:
    ACK 47f705b33f
  achow101:
    ACK 47f705b33f
  cbergqvist:
    re-ACK 47f705b33f
  theStack:
    Code-review ACK 47f705b33f

Tree-SHA512: e451bf4b801f193239ee434b6b614f5a2ac7bb49c70af5aba24c2ac0c54acbef4672556800e4ac799ae835632bdba716209c5ca8c37433a6883dab4eb7cd67c1
2024-06-11 17:28:51 -04:00
..
2024-05-21 10:29:51 +01:00
2024-06-10 07:54:48 -04:00
2024-05-20 16:48:19 +00:00
2023-10-12 11:27:19 +02:00
2024-04-10 17:01:27 +02:00
2022-12-24 23:49:50 +00:00
2024-05-21 09:14:55 +02:00
2024-03-04 19:53:30 -05:00
2023-11-21 13:15:44 +00:00
2023-12-11 18:22:13 +01:00
2024-03-26 16:51:46 +00:00
2023-11-16 11:36:22 +10:00
2024-02-11 15:25:07 +01:00
2024-06-10 07:54:48 -04:00
2023-09-13 11:37:45 +01:00
2024-05-20 16:48:19 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-11-30 11:28:19 +01:00
2024-05-14 10:24:31 +02:00
2024-05-14 10:24:31 +02:00
2024-05-20 16:48:19 +00:00
2023-01-12 13:42:44 +00:00
2024-04-01 14:37:24 -04:00
2024-04-01 14:37:24 -04:00
2023-11-16 11:36:22 +10:00