Topic: Comment on Issue Report #1014: Templates really ambiguous?
Author: "Johannes Schaub (litb)" <schaub-johannes@web.de>
Date: Mon, 5 Apr 2010 14:13:24 CST Raw View
The partial ordering rules of 14.9.2.4 clearly prefer the first template,
since it's more cv-qualified and thus the first type of the first template
is more specialized, making the whole template more specialized since the
other template for that type is at least as specialized too, but not more
specialized. For partial ordering we don't use the types of the
specialization, but the dependent types of the template declaration.
Am i missing something?
--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use
mailto:std-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.edu>
]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: =3D?ISO-8859-1?Q?Daniel_Kr=3DFCgler?=3D <daniel.kruegler@googlemail.c=.om>
Date: Wed, 7 Apr 2010 11:19:36 CST Raw View
On Apr 5, 10:13 pm, "Johannes Schaub (litb)" <schaub-johan...@web.de>
wrote:
> The partial ordering rules of 14.9.2.4 clearly prefer the first template,
> since it's more cv-qualified and thus the first type of the first templat=
e
> is more specialized, making the whole template more specialized since the
> other template for that type is at least as specialized too, but not more
> specialized. For partial ordering we don't use the types of the
> specialization, but the dependent types of the template declaration.
>
> Am i missing something?
There is some history behind the issue. First, when it was originally
submitted, it was not clear whether the wording of
[temp.deduct.partial]/6
"If both P and A were reference types [..]" should be interpreted as
(a) both were lvalue references *or* both were rvalue references
or (b) both were references types of any combination. With
interpretation
(a), neither template is more specialized than the other.
It was later recognized that the wording could indeed be applied,
when *different* reference types (mixture case (b)) where involved
and with this view the example is no longer ambiguous as you
correctly point out. AFAIK there is already an NB comment in
preparation regarding that particular example in regard to this
point and I have been told that the issue will be updated in regard
to this reinterpretation in a future issue list revision..
The issue still exists, because it is not yet clear whether the
mixture
cases (of different reference types) in partial overloading are
properly
ruled in all parts of the standard, therefore there is some survey
underway to ensure that the standard is consistent in this regard.
HTH & Greetings from Bremen,
Daniel Kr=FCgler
--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use
mailto:std-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.edu>
]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]