On Thu, 02 Feb 2012 00:37:15 +0100
"Matt D." <> wrote:
> On 2/1/2012 14:08, Thomas Boell wrote:
> > You could do something like this:
> >
> > #define FRUIT_VALUES \
> > APPLE, \
> > BANANA, \
> > ORANGE
> >
> > enum Fruit
> > {
> > FRUIT_VALUES
> > };
> >
> > enum Things
> > {
> > FRUIT_VALUES,
> > BEERCAN, CAR, ALOT
> > };
> >
> > Whether using the preprocessor like this is "good style" depends on
> > your point of view.
>
> It's seems very much like inheritance, so it made me think that perhaps
> using something along the following could be of use:
> http://www.codeproject.com/Articles/...-a-C-enum-type
He forgot to start the NewFruits enum values after the end of Fruit, so
he will not be able to distinguish Apples from Oranges.