From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8d472879e3f609e0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-03 07:49:56 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshosting.com!news-xfer1.atl.newshosting.com!uunet!dca.uu.net!ash.uu.net!spool0902.news.uu.net!not-for-mail Date: Tue, 03 Jun 2003 10:49:49 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Case sensitivity (was Re: no title) References: <20619edc.0306021018.6ee4dd09@posting.google.com> <1054649187.11497@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1054651789.285340@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1054651795 14814 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:38489 Date: 2003-06-03T10:49:49-04:00 List-Id: Preben Randhol wrote: > Please explain how you do this in a real C++ program? > type color is ( Red, Green, Blue ); > type mood is ( Cheerful, Angry, blue ); In C or C++, an enumeration declaration is not a scope. In C++, if you need overloaded enumerators, you must wrap them in a namespace and then always qualify the duplicates. namespace color { enum e { Red, Green, Blue }; } namespace mood { enum e { Cheerful, Angry, Blue }; } using namespace color; using namespace mood; color::e my_c1 = Red; color::e my_c2 = color::Blue; mood::e my_m1 = Angry; mood::e my_m2 = mood::Blue; No C++ programmer would declare mood the way you did, with some enumerators capitalized and others not (except perhaps for sentinel ones). But in C++ it would not be unusual for someone to write class Frob { /* ... */ }; Frob frob;