From: Nicholas Lee <nlee011@math.auckland.ac.nz>
To: Alexandre Oliva <oliva@dcc.unicamp.br>
Cc: egcs@cygnus.com
Subject: Re: Is this template problem in ecgs?
Date: Wed, 24 Jun 1998 04:14:00 -0000 [thread overview]
Message-ID: <Pine.GSO.3.96.980624231042.19548A-100000@matu1.math.auckland.ac.nz> (raw)
In-Reply-To: <or90mnt67p.fsf@zecarneiro.lsd.dcc.unicamp.br>
On 24 Jun 1998, Alexandre Oliva wrote:
> Nicholas Lee <nlee011@math.auckland.ac.nz> writes:
>
> > template<typename T>
> > inline T& min(const T& x, const T& y) { return (x<y)? x:y; }
>
> Not a template problem, actually. It would also compile if you
> replaced `template<typename T>' with `typedef int T;'. It seems that
> gcc disregards CV-qualification if the return value is a ?:
> expression, but I haven't investigated the problem very much.
What is the correct behaviour?
I would assume since x and y are declared as const T&, that the compiler
should issue a warning that there was a attempt to discard constness without
a const_cast.
--
"I reserve the right to contradict myself."
Nicholas Lee (Li Peng Ming) n.lee with math.auckland.ac in nz
Auckland University, New Zealand
next prev parent reply other threads:[~1998-06-24 4:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-23 22:55 Nicholas Lee
1998-06-24 4:06 ` Alexandre Oliva
1998-06-24 4:14 ` Nicholas Lee [this message]
1998-06-24 10:08 ` Alexandre Oliva
1998-06-24 18:13 ` Joe Buck
[not found] ` <199806250024.RAA14322.cygnus.egcs@atrus.synopsys.com>
1998-06-26 17:02 ` Nathan Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.3.96.980624231042.19548A-100000@matu1.math.auckland.ac.nz \
--to=nlee011@math.auckland.ac.nz \
--cc=egcs@cygnus.com \
--cc=oliva@dcc.unicamp.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).