Topic: Proposal for amendment to C/C++ standard regarding conditional
Author: musiphil@bawi.org (Seungbeom Kim)
Date: Fri, 1 Dec 2006 22:21:47 GMT Raw View
Ron Natalie wrote:
> Michel Colman wrote:
>=20
>> However, both operands can easily be converted to the common type
>> `const int * const *'.=20
>=20
> Of the entire realm of available types, how is the compiler supposed
> to pick some common third type? What happens when there is more than
> one invented third type? You could throw the volatile qualfiers in the
> mix to add a few more. They can both be converted to void
> as well.
It can pick the "most constrained" common type,
=E0 la the least common multiple (LCM) in mathematics.
Isn't such a type guaranteed to be unique for a given pair of types?
--=20
Seungbeom Kim
---
[ 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.comeaucomputing.com/csc/faq.html ]
Author: ron@spamcop.net (Ron Natalie)
Date: Sat, 2 Dec 2006 22:40:16 GMT Raw View
Seungbeom Kim wrote:
> Ron Natalie wrote:
>> Michel Colman wrote:
>>
>>> However, both operands can easily be converted to the common type
>>> `const int * const *'.=20
>> Of the entire realm of available types, how is the compiler supposed
>> to pick some common third type? What happens when there is more than
>> one invented third type? You could throw the volatile qualfiers in th=
e
>> mix to add a few more. They can both be converted to void
>> as well.
>=20
> It can pick the "most constrained" common type,
> =E0 la the least common multiple (LCM) in mathematics.
> Isn't such a type guaranteed to be unique for a given pair of types?
>=20
There's no guarantee of a unique type. While the CV-qualifiers
have a week relationship, there may be other types still that
are not.
The C++ overloading matching rules rely on having a bounded
set of things that are being considered for the conversion.
---
[ 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.comeaucomputing.com/csc/faq.html ]
Author: Ron Natalie <ron@spamcop.net>
Date: Fri, 1 Dec 2006 10:07:58 CST Raw View
Michel Colman wrote:
>
> However, both operands can easily be converted to the common type `const
> int * const *'.
Of the entire realm of available types, how is the compiler supposed
to pick some common third type? What happens when there is more than
one invented third type? You could throw the volatile qualfiers in the
mix to add a few more. They can both be converted to void
as well.
---
[ 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.comeaucomputing.com/csc/faq.html ]