I get this error:
IntelliSense: no suitable conversion function from "lambda []void (Form::Form *arg1)->void" to "Form::OnLoad" exists c:\users\topkek\desktop\project\test\tset\test\main.cpp
Real error:
Error 8 error C2440: 'type cast' : cannot convert from '`anonymous-namespace'::' to 'Form::OnLoad' c:\users\topkek\desktop\project\test\tset\test\main.cpp
This is the code:
new Form::Form("TEST_MAIN", "Test main", (Form::OnLoad)[](Form::Form* arg1)->void {
form.h:
typedef void(*OnLoad)(Form*);
Form(const char* WindowClass, const char* Title, OnLoad Func = NULL);
Form.cpp:
Form::Form(const char* szWindowClass, const char* Title, OnLoad Func) {
That is one weird lambda :)
I'm not sure what exactly you are trying to do, but you don't need a lambda for this:
If you want a lambda, drop the start: