[Help] Function pointer & lambda function

Hi, i have trouble with function pointer & lambda function.

The pointer cannot point to class’ function nor lamba function with capture.

can you fix my code below?

typedef void(*MyHandler)();

void target1() {

}
MyHandler h1 = target1; // <== works

class testClass {
public:
	void test() {
		MyHandler h2 = targert2; // <== compile error
	}

	void targert2() {

	}

	void testLambda() {
		MyHandler h3 = []() { // <== works
			// do something
		};


		MyHandler h4 = [this]() { // <== compile error
			// do something
		};
	}
};

You cannot use a class member as a function pointer as you do. MyHandler needs to be something like "typedef void(testClass::*MyHandler)()" for that to work.

EDIT: Try to look at this.