There isn't any way, at compile time, to verify all of the enumeration values 
are in the `Lexicon`.  If that is really important then one could use 
`set_default` with a function to log when a missing value is hit. There is also 
the problem that in many cases we have an extra value that shouldn't be there 
(e.g. `LAST_VALUE`). There are also use cases where the type is an integral 
type and not actually an enumeration. Nothing in the `Lexicon` API requires an 
enumeration.

I could look at creating a constructor like
```
template < size_t N > Lexicon(const std::array<Definition, N> &defines);
```
and then the initialization could be
```
Lexicon<Ex> ExNames(std::array<Lexicon<Ex>::Definition, Ex::LAST_VALUE> { ...});
```
In this case, if there are not exactly `Ex::LAST_VALUE` initializers for the 
`array`, it is a compile error.

[ Full content available at: https://github.com/apache/trafficserver/pull/4222 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to