Topic: integral promotion vs intergral conversion in overloading resoluton


Author: ikosarev@online.ru ("Ivan A. Kosarev")
Date: Tue, 15 Mar 2005 00:16:22 GMT
Raw View
Hello,

C++98 13.3.1, Table 9 says that there is a difference between ranks of
integral promotion and integral conversion affecting overloading resolution
mechanisms. Also, 8.5 says that that a copy-initializations cause no
promotions, i.e., initializing values converts, if necessary, to
cv-unqualified versions of destination types.

However, considering the code below

void f(int) { }
void f(long) { }

void g()
{
   char c;
    f(c);  // does c promotes to or converts to int here?
}

I've found that both EDG 3.5 and MSVC 7.1 call f(int) here. So, my question
is whether integral promotions are really any conversions matching (by
source and destination types) to intergral promotions (like in the example
above) or conversions are integral promotions only when integral promotions
are expected and should be performed (like in a case of promotion of
operator operands)?

Thanks.

--
Ivan

Unicals Group -- Development Tools for OEMs
http://www.unicals.com


---
[ 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                       ]