> Here's a workaround, but it's very painful if it affects a lot of
> functions, and it's a performance hit as well, since you need to call yet
> another virtual function:
Actually, the shim needs to be virtual, but the implementation doesn't.
I had less than two dozen functions total, and my interfaces were for
decoupling rather than polymorphism, so I had already made the interface
match exactly, but I wanted to get the bug validated because rejecting
compliant code obviously isn't pretty.
> class CSkewEstimator : public ISkewEstimator
> {
[quoted text clipped - 4 lines]
>
> };
Tamas Demjen - 22 Mar 2007 23:37 GMT
> I wanted to get the bug validated because rejecting
> compliant code obviously isn't pretty.
If you need more confirmation, I have the standard draft in front of me,
date: 2005-10-19, page 247, 13.1 Overloading:
"Parameter declarations that differ only in the presence or absence of
const and/or volatile are equivalent. That is, the const and volatile
type-specifiers for each parameter type are ignored when determining
which function is being declared, defined, or called."
"Only the const and volatile type-specifiers at the outermost level of
the parameter type specification are ignored in this fashion"
So "double* pdRetval" is equivalent to "double* const pdRetval" from the
overload's point of view.
Obviously "double*" is not equivalent to "const double*".