Topic: P0191R1 (comparing PMF to virtuals): why only one


Author: Thiago Macieira <thiago@macieira.org>
Date: Fri, 15 Jul 2016 20:18:34 -0700
Raw View
The proposal suggest changing the section of the standard that says that if
you compare PMFs to virtual functions the result is unspecified to saying that
if only one of the two is to a virtual, the result is unspecified.

That means that if you accidentally compare a pointer to a virtual to a
pointer to a non-virtual, you can't be guaranteed that the comparison will be
false. Why is that? What is the motivation for going only half-way, instead of
making the comparison well-defined?

Note that you can't tell whether a PMF points to a virtual function or not, so
I'd argue that the change makes no improvement to the real world. Code that
depends on comparing PMFs simply will continue to do so in implementation-
specified maner.

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/20472706.kMdGmgTJU7%40tjmaciei-mobl1.

.