Boost logo

Boost :

Subject: Re: [boost] [enums] Interest in an alternative emulation of scoped enums classes
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-02-28 03:03:33


Oliver Kowalke wrote:
>
> Hi Vicente,
>
>> BOOST_ENUM_CLASS_START(algae, uint8) {
>> green, red, cyan
>> } BOOST_ENUM_CLASS_END(algae, uint8)
>>
>> algae sample( algae::red );
>> void func(algae);
>
> does your lib return a textual representation for the enum, like:
>
> algae ag( algae::green);
> std::cout << ag.str() << "\n"; // prints out 'green'
>
>

Hi Oliver,

No, it doesn't and I can not do it with the current macros. With the PP-SEQ
and the variadic macros I could generate something allowing print a textual
representation for the enum as the Enum library in the Vault does,

std::cout << c_str(ae) << "\n"; // could prints out 'green'

but I'm sure this will be begin of long list of requests, locales
adaptations, input from a string representation, ... I would prefer to
concentrate on a pure scoped enum classes emulation for the first release of
the library.

Best,
Vicente

-- 
View this message in context: http://boost.2283326.n4.nabble.com/enums-Interest-in-an-alternative-emulation-of-scoped-enums-classes-tp3327113p3327590.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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