From -2892753122196202578
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ccb40040597f37a7
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-03-04 08:45:35 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: nagle@animats.com (John Nagle)
Newsgroups: comp.std.c++
Subject: Extending enums (was Re: Forward declaration of enum)
Date: Tue, 4 Mar 2003 16:45:34 +0000 (UTC)
Organization: Prodigy Internet http://www.prodigy.com
Lines: 23
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <mKY8a.1209$U24.78230781@newssvr21.news.prodigy.com>
References: <pOqblMCSSSX+Ewcy@robinton.demon.co.uk> <memo.20030302145753.26945C@brangdon.madasafish.com> <m3n0kdt4cg.fsf@uniton.integrable-solutions.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1046796334 18099 10.0.0.1 (4 Mar 2003 16:45:34 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 4 Mar 2003 16:45:34 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 18qFXo-0004hm-00
	for mail2news@news.news.demon.net; Tue, 04 Mar 2003 16:45:32 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id DAA17776; Wed, 5 Mar 2003 03:45:28 +1100 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
X-Newsgroups: comp.std.c++
X-NNTP-Posting-Date: Tue, 04 Mar 2003 02:38:58 EST
X-UserInfo1: SCSGW^_D\JUQB\D[NCOF_W\@PJ_^PBQLGPQRZ_MHEQR@ETUCCNSKQFCY@TXDX_WHSVB]ZEJLSNY\^J[CUVSA_QLFC^RQHUPH[P[NRWCCMLSNPOD_ESALHUK@TDFUZHBLJ\XGKL^NXA\EVHSP[D_C^B_^JCX^W]CHBAX]POG@SSAZQ\LE[DCNMUPG_VSC@VJM
X-MailScanner: PASSED (v1.2.7 63101 h247d0vm072120 mailbox4.ucsd.edu)
X-Spam-Status: No, hits=-6.6 required=5.0
	tests=INVALID_MSGID,IN_REP_TO,NOSPAM_INC,REFERENCES,
	      SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MOZILLA_UA,
	      X_ACCEPT_LANG
	version=2.41
Xref: archiver1.google.com comp.std.c++:18157

   More usefully, some way to define a new enum type which
references another enum type and is guaranteed not to have
clashing values would be useful.  Something like

	enum lowcolors { red, green, blue };
....
	enum highcolors{ pink=lastof(lowcolors), magenta, cyan };

It's common to see a new set of constants started from the
last value of another set in some previously defined file.
This breaks when someone adds a new constant in the first file.

    Probably not worth the trouble, though.

			John Nagle
			Animats

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



