Boost logo

Boost :

Subject: Re: [boost] [C++0x] Emulation of scoped enums
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2009-03-05 12:38:43


Phil Endecott a écrit :
> - How about avoiding the _START/_END stuff with e.g.
> BOOST_SCOPED_ENUM_DECL(algae, green,red,cyan);
> (I had been under the impression that varargs macros were a gcc-ism,
> but I've recently discovered that they're in c99; do non-gcc C++
> compilers generally allow them? I don't think we can get away with
> allowing only up-to-N elements in this case.)
>
Evenif variadic macro is not supported, Boost::Preprocessor sequence can :

BOOST_SCOPED_ENUM_DECL(algae, (green)(red)(cyan) );

or Boost::Preprocessor array

BOOST_SCOPED_ENUM_DECL(algae, (3,(green,red,cyan) );

-- 
___________________________________________
Joel Falcou - Assistant Professor
PARALL Team - LRI - Universite Paris Sud XI
Tel : (+33)1 69 15 66 35

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