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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!news-east.rr.com!news.rr.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!panix!panix2.panix.com!not-for-mail From: comeau@panix.com (Greg Comeau) Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 13 Mar 2005 09:20:19 -0500 Organization: Comeau Computing; http://www.comeaucomputing.com Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110655701.196383@athnrd02> <1110700112.230910@athnrd02> Reply-To: comeau@comeaucomputing.com NNTP-Posting-Host: panix2.panix.com X-Trace: reader1.panix.com 1110723619 14261 166.84.1.2 (13 Mar 2005 14:20:19 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sun, 13 Mar 2005 14:20:19 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:9312 comp.lang.c++:45412 comp.realtime:1419 comp.software-eng:4982 Date: 2005-03-13T09:20:19-05:00 List-Id: In article <1110700112.230910@athnrd02>, Ioannis Vranos wrote: >Greg Comeau wrote: >>>Now that I am thinking of it, isn't it a value range? >>>int main() >>>{ >>> enum four_val {a,b,c,d}; >>> >>> four_val x; >>> >>> x = 4; >>>} >>> >>>C:\c>g++ temp.cpp -o temp.exe >>>temp.cpp: In function `int main()': >>>temp.cpp:7: error: invalid conversion from `int' to `main()::four_val' >> >> In C++ but not in C it's an error, but it can also be "invalidly" >> cast to the enum. > >Yes, the subject in this thread is C++ and Ada. :-) > >Also casting this means that you know what you are doing, and thus not >excused for mistakes. :-) > >Thus you can't do that by accident. *You* can not, but somebody else can :) :) -- Greg Comeau / Comeau for the Mac? Stay tuned. Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it?