[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: kdemultimedia/noatun/modules/metatag
From: Neil Stevens <neil () qualityassistant ! com>
Date: 2003-05-11 13:07:55
[Download RAW message or body]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday May 11, 2003 05:41, Luis Pedro Coelho wrote:
> Le Dimanche 11 Mai 2003 14:29, Neil Stevens a écrit :
>
> There is no (int,int,int ...) constructor, but three of them work with
> (0,0,false...) if you assume that there is a const char* -> QString
> conversion (no QT_CAST_ASCII defined).
>
> > KDialogBase( QWidget *parent=0, const char *name=0, bool modal=true,
>
> 0 -> QWidget*
> 0 -> const char*
> false -> bool
>
> > KDialogBase( int dialogFace, const QString &caption, int buttonMask,
>
> 0 -> int
> 0 -> const char* -> const QString&
> false -> int
>
> > KDialogBase( int dialogFace, const QString &caption, QWidget *parent=0
>
> 0 -> int
> 0 -> const char* -> const QString&
> false -> QWidget*
>
> Actually, I think the compiler should choose the first one since there
> is only two automatic conversions, while the others need longer chains
> with a user-defined conversion, but I am not really sure.
The first one should always work, yes. According to The C++ Programming
Language:
"[To find the right version of an overloaded function] a series or criteria
are tried in order:
"[1] Exact match; thiat is, match using no or only trivial conversions (for
example, array name to pointer, function name to function pointer, and T
to const T)
[2] Match using promotions; that is , integral promotions (bool to int,
char to int, short to int, and their unsigned counterparts) and float to
double
[3] Match using standard conversions (for example, int to double, double to
int, double to long double, Derived* to Base*, T* to void *, int to
unsigned int)
[4] Match using user-defined conversions
[5] Match using the ellipsis ... in a function declaration
"If two matches are found at the highest level where a match is found, the
call is rejected as ambiguous."
Of the three listed, only one doesn't use user-defined conversions. So
there is no kdelibs bug. It's a gcc prerelease bug.
> Anyway, disambiguating is probably best.
It's not bad, but it shouldn't keep us from making sure source
compatibility is kept.
- --
Neil Stevens - neil@qualityassistant.com
"The shepherd drives the wolf from the sheep's throat, for which the
sheep thanks the shepherd as a liberator, while the wolf denounces him
for the same act as the destroyer of liberty." -- Abraham Lincoln
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+vksrf7mnligQOmERAoMJAJ0e7TrzlxsmpLxx8U8XDm42zmplZwCeIR4S
zQiqLZ4Q4at7TgAIEP0rGxQ=
=Zowt
-----END PGP SIGNATURE-----
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic