From: "Hyman Rosen" <hyman.rosen@gmail.com>
Subject: Re: Ada & MacOS
Date: 6 Feb 2006 12:34:31 -0800
Date: 2006-02-06T12:34:31-08:00 [thread overview]
Message-ID: <1139258071.934930.179710@g14g2000cwa.googlegroups.com> (raw)
In-Reply-To: 4047936.ucMNu27ket@linux1.krischik.com
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<R,P>(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.
next prev parent reply other threads:[~2006-02-06 20:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-02 10:53 Ada & MacOS sg
2006-02-02 14:48 ` Alex R. Mosteo
2006-02-02 17:13 ` Martin Krischik
2006-02-02 19:37 ` sg
2006-02-02 21:30 ` Björn Persson
2006-02-02 23:17 ` sg
2006-02-03 7:32 ` Jean-Pierre Rosen
2006-02-03 19:38 ` Jeffrey R. Carter
2006-02-06 10:15 ` Jean-Pierre Rosen
2006-02-03 16:27 ` Martin Krischik
2006-02-03 19:43 ` Jeffrey R. Carter
2006-02-04 7:04 ` Martin Krischik
2006-02-04 14:32 ` Georg Bauhaus
2006-02-06 8:20 ` Maciej Sobczak
2006-02-06 18:48 ` Jeffrey R. Carter
2006-02-06 20:44 ` Hyman Rosen
2006-02-07 9:10 ` Maciej Sobczak
2006-02-07 16:16 ` Martin Krischik
2006-02-08 4:51 ` Jeffrey R. Carter
2006-02-08 7:35 ` Alex R. Mosteo
2006-02-09 14:52 ` Maciej Sobczak
2006-02-06 19:25 ` Martin Krischik
2006-02-06 20:34 ` Hyman Rosen [this message]
2006-02-07 16:13 ` Martin Krischik
2006-02-03 23:55 ` Simon Williams
2006-02-04 16:22 ` Adrian Hoe
2006-02-04 16:25 ` Adrian Hoe
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox