Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 01/09/2013 05:02 PM, Lubos Lunak wrote:
  So that other people don't have to search: According to my reading of the
standard (mainly 13.3.3.1.1 and 13.3.3.2 [*]), this is because when choosing
which conversion for overloaded functions is better, the standard treats all
integer conversions[**] the same. I'm a bit confused by "the rank of S1 is
better than the rank of S2," in 13.3.3.2, since reading also 4.13 I would say
that long and long long have different rank, therefore int->long should be
prefered to int->long long, but a test with all GCC, Clang and MSVC shows
that having f( long ) and f( long long ) makes f( 0 ) ambiguous :(. Makes me
wonder if there is some obscure reason for this or if just the person coming
up with this was having a bad day.

The concept of "integer conversion rank" ([conv.rank] aka 4.13, new in C++11, borrowed from C) is completely independent of the concept of "conversion rank" in [over.match.best] (aka 13.3.3).

Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.