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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1901f265c928a511 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsread.com!newsstand.newsread.com!POSTED.monger.newsread.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Typing in Ada From: "Peter C. Chapin" References: Organization: Kelsey Mountain Software Message-ID: User-Agent: Xnews/5.04.25 Date: Tue, 01 Jun 2004 11:26:30 GMT NNTP-Posting-Host: 216.114.169.186 X-Complaints-To: Abuse Role , We Care X-Trace: monger.newsread.com 1086089190 216.114.169.186 (Tue, 01 Jun 2004 07:26:30 EDT) NNTP-Posting-Date: Tue, 01 Jun 2004 07:26:30 EDT Xref: controlnews3.google.com comp.lang.ada:988 Date: 2004-06-01T11:26:30+00:00 List-Id: tmoran@acm.org wrote in news:XMTuc.35148$n_6.31103@attbi_s53: > I assumed by "C" you really meant something newer, like "C++". In "C" > "the only operations that you can perform on a structure are take its > address with &, and access one of its members." (The C Programming > Language, Kernighan and Ritchie). > In any case, I'd be curious to see how you would write the above in C++. C++ supports operator overloading as applied to enums. It doesn't have an exponentiation operator, however, and you can't create new operators so that would create a technical inconvenience in this case. Off hand I'm not sure how one would create a function template in C++ that could take an enumeration type and print the names of the enumerators. I wouldn't want to say it's impossible though. In any case I'm not sure how that's related to the issue of strong typing. Peter