Message from discussion
Template argument deduction fails on EDG - but why?
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.cse.psu.edu!uwm.edu!rpi!not-for-mail
From: "Rani Sharoni" <rani_shar...@hotmail.com>
Newsgroups: comp.lang.c++.moderated
Subject: Re: Template argument deduction fails on EDG - but why?
Date: 13 May 2003 00:53:02 -0400
Organization: unknown
Lines: 47
Sender: cppm...@netlab.cs.rpi.edu
Approved: hsut...@gotw.ca
Message-ID: <3ebff6b4@news.microsoft.com>
References: <b9j9g9$bu9$1@news.tuwien.ac.at>
<3ebe3da0@news.microsoft.com>
<b9m242$rji$1@news.tuwien.ac.at>
NNTP-Posting-Host: netlab.cs.rpi.edu
X-Original-Date: Mon, 12 May 2003 22:32:06 +0300
X-Submission-Address: c++-sub...@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
iQBVAwUAPsB6K0HMCo9UcraBAQGVCwH/VGo1tyM5F8chKYxIak5yQS6fvMGJtIak
feQQW1NExnS41Nr8LBkriIT98NLSTFOkB17H2esVSF1zsnyKwPtfsg==
=ih1i
Stefan Slapeta wrote:
> Hi Rani,
> "Rani Sharoni" <rani_shar...@hotmail.com> wrote:
>> The current language doesn't say anything about cv-qualified
>> conversions between pointers/references to array types although it
>> seems to be safe as cv-qualified pointers conversion (can't break
>> the type system).
>>
Hi,
I was wrong about the conversion. The conversion from T to T cv& (or T
cv*)
is obviously allowed even when T is of array type.
The DR link that I mentioned isn't relevant. Sorry.
Back to your original question.
I compiled the code also with GCC3.2 and VC7.1. GCC rejected the code
while
VC accepted it.
> I think that's not really true, especially as there are strict rules
> for type deduction in function template calls. Take a look at
> [14.8.2.1] where it says:
I looked at 14.8.2 (especially 14.8.2.1/3) and I didn't see any
treatment in
the case (conversion) you presented. Notice that the following actually
works (EDG and GCC):
template<typename T> int test(T const&);
In this case T==int[10] and test<int[10]> is instantiated (per
14.8.2.1/3).
> There are no DRs on these lines, so I think EDG behaves incorrectly
> here.
I'm really not authorized to say that but maybe Daveed Vandevoorde can
help
us with this issue.
Regards,
Rani
[ Send an empty e-mail to c++-h...@netlab.cs.rpi.edu for info ]
[ about comp.lang.c++.moderated. First time posters: do this! ]