[Autofill] Added type-safe bitset.
This CL adds a type-safe set container for dense integers, following std::set's API. Currently, there are multiple use-cases in Autofill of the following two patterns to express sets of small, dense integers: Pattern 1: enum class E { A = 1, B = 2, C = 3, ... }; std::set<E> set; set.insert(B); Pattern 2: enum E { A = 1 << 0, B = 1 << 2, C = 1 << 3, ... }; uint32_t bitmask = 0; bitmask |= B; This CL's container combines the type-safety of the former pattern with the efficiency of the latter. Bug: 1007974 Change-Id: Ida9b9cec244119a27eca2c171b4fb2f52443d099 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2350423 Commit-Queue: Christoph Schwering <schwering@google.com> Reviewed-by:Jan Wilken Dörrie <jdoerrie@chromium.org> Cr-Commit-Position: refs/heads/master@{#820983}
Showing
This diff is collapsed.
Please register or sign in to comment