In this case
void f(int *);
void f(const int *);
...
int i;
f(&i);
the situation is pretty clear - f(int *) gets called which seems right.
However, if I have this (it was done like that by mistake(*) ):
class aa
{
public:
operator bool() const;
operator char *();
};
void func(bool);
aa a;
func(a);
operator char *() gets called. I cannot figure out why would such decision path be better than going to operator bool(). Any ideas?
(*) If const is added to the second operator, the code works as expected, of course.