TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NEIL HELLER
from: DARIN MCBRIDE
date: 1997-09-22 19:38:00
subject: WHY THIS CONSTRUCTION?

NH>         enum status (out, in);
 NH>  
DM> enum status {out, in};  // :-)
 NH> My fingers just aren't what they used to be.  Thanks for the
 NH> correction.  Actually earlier in the day I was trying to learn how to
 NH> ride a motorcycle and dropped it - my left arm is in a cast.
Ouch.  Hope it still works when the bugs are taken out!  :-)
NH> const button::status out = button::out;
 NH> It just seems to me as though there is an excess of verbiage there. 
That's what you get for increasing your namespace!  You can have a global 
status ("::status") as well as one inside your button class 
("button::status") and in any other class.  You need to be able to specify 
which one you mean.
 NH> Had I first declared panic to be an instance of class button it seems
 NH> as though the above line would be totally unnecessary for use as:
 NH> if (panic.status) {
 NH> would assume an "in" position for status (or whatever I had enumerated
 NH> as not zero).
Remembering that status is your enum type, not your variable (which was 
"state"), the above would be meaningless.  :-)
 NH> Obviously I'm dead wrong in my assessment of the situation.  Can you
 NH> (or anybody for that matter) point me in the direction of concise (and
 NH> easily understandable) explaination of this?
Hmmmm... Perhaps some concise questions would gain concise answers... other 
than that, I don't know where I picked it up.  :-)
--- Maximus/2 3.01
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.