
8 Dec
2005
8 Dec
'05
2:46 p.m.
Frank Laub wrote:
As a related issue, it might be good to have the a similar struture which you can use to map from the enum value to the string value and vice versa. This runtime mapping should not require any heap-allocations .
values to be sequential from 0. This is where I want to go with BOOST_ENUM_VALUES(). It would require an extra column of data where the user would put their value portion. Then I could construct a map just as you are describing.
You kinda already have the values because the enumeration starts with value 0 and then increments each new item. Of course it would be nice/necessary to be able to specify the value if the defaults are not what one wants. -Thorsten