[sync] Add constexpr to EnumSet

constexpr allows the programmer to assert their intention that a
particular function or variable should be evaluatable at compile time
given the correct circumstances. If one adheres to the restrictions
imposed by constexpr, the compiler can often aggressively optimize
away code, leading to smaller binary size and improved performance.

This cl makes ModelTypeSet's varargs constructor as well as All() and
FromRange()
constexpr. It leverages this to make several of model_type.h's Types()
functions contexpr as well.

In my testing, this saves about 34 kb from the release binary. A
synthetic performance test that calls UserTypes(), CoreTypes() etc. in a
loop ran 3-4x faster on both debug and release builds, although the
magnitude of the difference was obviously smaller in the release builds.

Review-Url: https://codereview.chromium.org/2859033002
Cr-Commit-Position: refs/heads/master@{#478847}
19 files changed