I'm trying to call a member function that has a default variable value, ie: void func(size_t x = 1234) { }
Is there any way to omit the function parameter when called via a pointer to member function?
#include <iostream>
using namespace std;
class c
{
public:
int f(size_t x = 1234)
{
cout << x << endl;
return 1;
}
bool b;
};
int main(void)
{
typedef int (c::* c_member_function)(size_t x);
c_member_function ptr = &c::f;
c c_instance;
(c_instance.*ptr)(1);
return 0;
}