gluecodium icon indicating copy to clipboard operation
gluecodium copied to clipboard

Allow iterating over generated enums in C++

Open DanielKamkha opened this issue 6 years ago • 1 comments

[Original issue by Arsen Drambyan]

As a developer I need to iterate over all the values of an enum in C++ in order to verify that all the values are covered e.g. a conversion function, verified in a unit test.

Acceptance criteria would be any way to iterate over the values of an enum in C++.

DanielKamkha avatar Jan 15 '20 09:01 DanielKamkha

One possible solution is to generate an initializer-list of all enum values. Probably should not have it generated by default, but get it hidden behind an IDL attribute, like, @Cpp(ValueList) or something.

DanielKamkha avatar Jan 15 '20 09:01 DanielKamkha