How to improve C++ Program?

Pages: 12
It is possible to define an enumeration that has values not defined by any of its enumerators.


Yes. std::vector names has a size that allows any index from 0 to the maximum value of the enum values - each element initialised to "Invalid". L15 checks that the value of the given enum is within the permitted range and only accesses std::vector names if it is. L4 checks that all given enum values are >= 0.

So I'm probably having a senior moment here at the end of a long day- but what's the issue?
Is there a way to make changes to this program using C++ 17 features?


What part of the code doesn't compile as C++17? It compiles OK for me as C++17 with MS VS2022.

> L15 checks that the value of the given enum is within the permitted range ...
> L4 checks that all given enum values are >= 0

Ok; I didn't read it carefully enough; sorry about that.
Topic archived. No new replies allowed.
Pages: 12