Re: [C++] Best Way to ++booleans?

From: Jumbo (nospam)
Date: 01/28/04


Date: Wed, 28 Jan 2004 10:58:07 -0000


"Chris Newton" <chrisnewton@no.junk.please.btinternet.com> wrote in message
news:bv6tmb$bm1$1@titan.btinternet.com...
> James Connell wrote...
> > thanks Cris! i'm still learning C++, didn't know you could overload
> > on enums. would that remove the object overhead as well?
>
> Yep, good trick, in'it? :-)
>
> And yes, it's overhead-free. Manipulating enums like this is really no
> different to writing a function that works on something like an int, and
> indeed it's quite likely that under the covers, that's exactly what
> it'll compile down to.
>
Can't you change the type for the enumerator too?