Cast it:
WinApiFunc(static_cast<void(__stdcall *)()>(func));
Or store it into a local variable first:
void (__stdcall *funcp)() = func;
WinApiFunc(funcp);
More Related Contents:
- Explicit Return Type of Lambda
- Declaring lambda with int type not working [closed]
- C++ lambda with captures as a function pointer
- Move capture in lambda
- Passing capturing lambda as function pointer
- What is the type of lambda when deduced with “auto” in C++11?
- How is std::function implemented?
- Why can lambdas be better optimized by the compiler than plain functions?
- What is “Expression SFINAE”?
- Bind Vs Lambda?
- C++0x lambda capture by value always const?
- C++11 inheriting constructors and access modifiers
- C++11 lambda implementation and memory model
- Can lambda functions be templated?
- Lambda capture as const reference?
- Lifetime of lambda objects in relation to function pointer conversion
- Why can’t I capture this by-reference (‘&this’) in lambda?
- Lambda expressions as class template parameters
- Double delete in initializer_list vs 2013
- How to immediately invoke a C++ lambda?
- std::remove_if – lambda, not removing anything from the collection
- Lambda functions as base classes
- How do static variables in lambda function objects work?
- Weird MSC 8.0 error: “The value of ESP was not properly saved across a function call…”
- Lambdas and capture by reference local variables : Accessing after the scope
- How can I pass a C++ lambda to a C-callback that expects a function pointer and a context?
- Specializing a template on a lambda in C++0x
- Lambdas and std::function
- Using data member in lambda capture list inside a member function
- C++ priority_queue with lambda comparator error