From 8637351522913339939 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,da46f9d6feb862e5 X-Google-Attributes: gidf78e5,public From: fvali@biotrack.com Subject: Re: Is this well-formed? Date: 1999/04/16 Message-ID: <7f550u$pem$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 467031583 Approved: Fergus Henderson References: <7f1nnv$6c$1@weber.techno-link.com> X-Original-Date: Thu, 15 Apr 1999 16:44:16 GMT X-Http-User-Agent: Mozilla/4.04 [en] (WinNT; I) X-Complaints-To: news@news.unimelb.edu.au X-Http-Proxy: HTTP/1.1 dtw1 (Traffic-Server/2.0.4 [uScMs f p eN:t c Mi p s ]), 1.0 x17.dejanews.com:80 (Squid/1.1.22) for client 165.117.54.86 X-Trace: izvestia.its.unimelb.edu.au 924245791 27017 128.250.29.16 (16 Apr 1999 06:56:31 GMT) Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Apr 15 16:44:16 1999 GMT X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANxbfC+EDnX0m9pzZAQF3gwF9Fj6vJO5J3Cs0SM4ZVdau9GOkIvijurI5 s8/V+FFsjyil3XDc7/Y8H9ivNRwdM22C =Crsk NNTP-Posting-Date: 16 Apr 1999 06:56:31 GMT Newsgroups: comp.std.c++ I believe it is well-formed. f(int*) should be resolved as the best viable function according to the standard. During template argument deduction, standard conversions are not performed or considered. (They are if explicitly specified though, i.e f(0) will resolve to the template version) -hope that helps -fais In article <7f1nnv$6c$1@weber.techno-link.com>, "Peter Dimov" wrote: > Is the following program well-formed? > > template void f(U*) > { > } > > void f(int*) > { > } > > int main() > { > f(0); > return 0; > } > > Note: MSVC6SP2 rejects it: > > error C2784: 'void __cdecl f(U *)' : could not deduce template argument for > ' *' from 'const int' > > -- > Peter Dimov > Multi Media Ltd. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]