Re: [C++] Best Way to ++booleans?
From: Jumbo (nospam)
Date: 01/28/04
- Next message: Karl Heinz Buchegger: "Re: stl vector find."
- Previous message: Karl Heinz Buchegger: "Re: simple question on linked list insert"
- In reply to: Chris Newton: "Re: [C++] Best Way to ++booleans?"
- Next in thread: Attila Feher: "Re: [C++] Best Way to ++booleans?"
- Reply: Attila Feher: "Re: [C++] Best Way to ++booleans?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Next message: Karl Heinz Buchegger: "Re: stl vector find."
- Previous message: Karl Heinz Buchegger: "Re: simple question on linked list insert"
- In reply to: Chris Newton: "Re: [C++] Best Way to ++booleans?"
- Next in thread: Attila Feher: "Re: [C++] Best Way to ++booleans?"
- Reply: Attila Feher: "Re: [C++] Best Way to ++booleans?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]