Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-12-07 08:27:15

On 12/07/2005 05:47 AM, Frank Laub wrote:
> Hello fellow boosters,
> I've recently come up with a way to use the boost preprocesor to generate a
> 'better' enum type. The following is an example of some typical usage. Is
> anyone else interested in this sort of thing? I'm hoping to get suggestions

I'm interested.

> for how to make it more 'boost-like' in both its implementation and its
> usage. Is this very readable? Is there a place I can upload the code for
> people to peruse?

The boost file vault:

under the 'Preprocessor Metaprogramming' directory.
> #include <iostream>
> #include <boost/enum.hpp>
> #include <boost/foreach.hpp>
> #define foreach BOOST_FOREACH
> (Abort)("unrecoverable problem")
> (Error)("recoverable problem")
> (Alert)("unexpected behavior")
> (Info)("expected behavior")
> (Trace)("normal flow of execution")
> (Debug)("detailed object state listings")
> )
> int main()
> {
> foreach(const string& name, Level::names)
> {
> cout << name << endl;
> }
Tha above looks great, and I remember, several weeks or months
ago, there was a request for just such a utility on


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