Boost logo

Boost :

Subject: Re: [boost] [BENUM] Any interest in auto-generated enum-to/from-string functions, without longer/more-complex usage?
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-09-15 05:57:23


Tony D skrev:
> Anyone think this functionality belongs in boost? (I have working code)
>
> ENUM(X, B = N, C, D = B + C }; // or whatever
> X x1 = C;
> cout << x1 << '\n'; // outputs "C\n"
> X x2("D"); // construct from string...
> if (x2 == D) { will do }

The answer is "yes", but please compare with the smart enum proposal
that is already in the vault. I don't know the exact status of this, but
it looks close to review ready, although the author might not be working
on it.

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk