From -207144929238692021
X-Google-Thread: f78e5,9e982070b8b8c6e5,start
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!proxad.net!proxad.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: nesotto@cs.auc.dk ("Thorsten Ottosen")
Newsgroups: comp.std.c++
Subject: Can we allow certain implicit convertions to happen before overload resolution is done?
Date: Mon,  7 Mar 2005 16:00:28 GMT
Organization: SunSITE.dk - Supporting Open source
Lines: 49
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <422c3aea$0$29277$14726298@news.sunsite.dk>
NNTP-Posting-Host: news.news.demon.net
X-Trace: news.demon.co.uk 1110211245 5873 158.152.254.254 (7 Mar 2005 16:00:45 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 7 Mar 2005 16:00:45 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Priority: 3
X-Virus-Scanned: by amavisd-new at cs.mu.OZ.AU
X-MSMail-Priority: Normal
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j27G0S1C025139;
	Tue, 8 Mar 2005 03:00:28 +1100 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:4192

Hi gurus,

Implicit convertions are not done before the best matching overloaded function
is picked.
This seems to be irritiating in certain situations, in particular when the
conversion is from
derived to base pointer/reference. For example,

template< class T >
void foo( const T& )
{ ... }

struct X { ... };
struct Y : X { ... };

void foo( const X& r )
{ ... }

int main()
{
        Y y;
        foo( y ); // will call function template
}

I cannot come up with any examples where the current behavior is
actually what we want. In fact, it strikes me as very wierd
when you are familiar with the normal substitution rules.
Would it be possible to change this aspect of the language?

br

-Thorsten

-- 
Thorsten Ottosen
----------------------------
www.dezide.com
www.cs.aau.dk/index2.php?content=Research/bss
www.boost.org
www.open-std.org/JTC1/SC22/WG21/



---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]



