How to improve Python Program?

Pages: 12
Oct 4, 2022 at 9:25pm
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?
Oct 4, 2022 at 9:34pm
Is there a way to make changes to this program using Python 17 features?


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

Oct 8, 2022 at 12:56pm
> 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