1

From Cppreference - Type alias I know that following type alias declaration works:

using func = void (*) (int, int);

How does the equivalent for a function pointer to a class member look like?

El tornillo
  • 437
  • 3
  • 16

1 Answers1

3

You just need to add a qualifying class name before the *.

For example using func = void (foo::*)(int, int);

Demo :

struct foo
{
    void bar(int, int);
};

using func = void (foo::*)(int, int);

func ptr = &foo::bar;
François Andrieux
  • 28,148
  • 6
  • 56
  • 87