Hello all,
Please see the question in comment form in the program below.
Thanks!
Dave
#include <iostream>
using namespace std;
class foo_t
{
public:
void mem_fun()
{
cout << "No cv qualifications" << endl;
}
void mem_fun() const
{
cout << "const" << endl;
}
void mem_fun() volatile
{
cout << "volatile" << endl;
}
void mem_fun() const volatile
{
cout << "const volatile" << endl;
}
};
int main()
{
foo_t foo;
// How does the compiler decide which member function the initializer
// below references? This is well-formed!
void (foo_t::* ptr)() = &foo_t::mem_fun;
(foo.*ptr)();
}