Boost logo

Boost :

Subject: Re: [boost] [C++0x] Emulation of scoped enums
From: Beman Dawes (bdawes_at_[hidden])
Date: 2009-03-11 11:28:56


Andrey Semashev wrote:
> Beman Dawes wrote:
>> The improved type safety of the C++0x scoped enum feature is
>> attractive, so I'd like to start using it as it becomes available in
>> compilers.
>>
>> See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
>> for a description. Note that the committee changed the name from
>> strongly typed enums to scoped enums.
>>
>> See the attached for a boost/detail header that provides macro
>> wrappers that use scoped enums if available, otherwise fall back on
>> C++03 namespaces and unscoped enums. It lets a library write:
>
> Could this be rewritten to use structs instead of namespaces? This would
> allow to declare enums nested in classes.

Ha! Good point! Changed.

--Beman


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