Hi,
This is essentially a re-post of a message from a few days ago, with a
more
eye-catching subject line.
According to section 13.6 of the standard, an operator of the form
T& operator*(T*)
should be considered during overload resolution for an expression of the
form *x
where x has class type, only if T is a function type or an object type.
Since
void is not an object type, the no operator of the form operator*(void*)
should
be considered.
However, I'm getting a complaint of ambiguity from Codewarrior 9.3 and 9.4
relating to an expression *x, where x has type std::istream, in which one
of the
two candidate functions is described as operator*(void*). (See
http://tinyurl.com/626kr).
The following test program is a simplification of the code which leads to
the
above error.
struct Thing {
operator void* () const;
};
struct any {
template<class T>
any(T const&);
};
char operator*(any const&);
int main()
{
Thing t;
*t;
}
Any help would be greatly appreciated.
Best Regards,
Jonathan


|