Boost logo

Boost :

From: Richard Jennings (richard.jennings_at_[hidden])
Date: 2005-12-22 05:36:18

Here's a request for an extension to ENUM_VALUES for you to consider.

I need to use BOOST_ENUM_VALUES with type std::size_t so I can use the
method 'value' and use the result as an index to a vector. I would also
like to have an end-user readable description for the enumeration value.
Currently I hold this in a separate class that maps enumeration values to

 From what I understand, the enumeration tags have to be C++ names so no
spaces are allowed whereas end-users don't usually like CamelCase (or
whatever) unspaced C++ names.

Here's an example:
   (SampleIfg)(0)("Sample Interferogram")
   (SampleSpec)(1)("Sample Spectrum")
   (SamplePhase)(2)("Sample Phase")
   (RefIfg)(3)("Reference Interferogram"))

And then a method something like:
   const char* description() const;

Would anyone else find this useful?

Boost list run by bdawes at, gregod at, cpdaniel at, john at