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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,59d666bca086a225 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "Hyman Rosen" Newsgroups: comp.lang.ada Subject: Re: Ada & MacOS Date: 6 Feb 2006 12:34:31 -0800 Organization: http://groups.google.com Message-ID: <1139258071.934930.179710@g14g2000cwa.googlegroups.com> References: <1776691.hMkAr8ZQHy@linux1.krischik.com> <6SuEf.155126$dP1.513381@newsc.telia.net> <1289921.BRApYLEfLn@linux1.krischik.com> <4047936.ucMNu27ket@linux1.krischik.com> NNTP-Posting-Host: 204.253.249.72 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1139258077 3737 127.0.0.1 (6 Feb 2006 20:34:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 6 Feb 2006 20:34:37 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=204.253.249.72; posting-account=lJDDWg0AAACmMd7wLM4osx8JUCDw_C_j Xref: g2news1.google.com comp.lang.ada:2801 Date: 2006-02-06T12:34:31-08:00 List-Id: Martin Krischik wrote: > unsigned& key (int& x) { return x; } Here's what a modern C++ compiler says: Comeau C/C++ 4.3.3 (Aug 6 2003 15:13:37) for ONLINE_EVALUATION_BETA1 Copyright 1988-2003 Comeau Computing. All rights reserved. MODE:strict errors C++ "ComeauTest.c", line 4: error: a reference of type "unsigned int &" (not const-qualified) cannot be initialized with a value of type "int" return x; ^ > Of corse not at easy as displayed here. It was deeply nested inside a > template. So one could not the see the type mismatch imediatly. The same compiler as above, with a template: "ComeauTest.c", line 2: error: a reference of type "int &" (not const-qualified) cannot be initialized with a value of type "unsigned int" R &key (P &x) { return x; } ^ detected during instantiation of "R &key(P &) [with R=int, P=unsigned int]" > But how about a little quiz: Which of the two compiler in question where > right? Neither, of course. > Or a little test: We ask comp.lang.cpp which of the two compiler in question > where right? The place to ask is comp.lang.c++.moderated or comp.std.c++ (the unmoderated groups are too noisy - c.l.a should have such problems!) > I can tell you: If you ask a question like this here in c.l.a then in less > then 24 hours you have an answer beginning with: > > In the RM X.Y.Z(W) it says .... I assure you, in either of those groups I mention, you will have Standard C++ quoted at you chapter and verse to your heart's content, and quickly too.