components/sync/base/enum_set.h contains a specialized implementation of a set of enums. That's arguably useful, but its current iterator interface is quite inconvenient to use. We should consider making it standard-iterator-compliant, so that it can be used in range-based for loops.
Example:
We could replace
for (EnumSet<EnumType>::Iterator it = enums.First(); it.Good(); it.Inc()) {
DoStuff(it.Get());
}
with
for (EnumType value : enums) {
DoStuff(value);
}
Note that a comment on EnumSet [1] claims that its iterator semantics are very different from standard iterators, but that doesn't seem to be true.
https://cs.chromium.org/chromium/src/components/sync/base/enum_set.h?rcl=dc7f5252145dbef0c1663176a90e86285d5e0e3b&l=55
Comment 1 by vitaliii@chromium.org
, Jul 18Status: Started (was: Available)