I do not understand why neither the lambda nor the function are recognized as an std::invocable
compliant types in the following code:
#include <concepts>
#include <iostream>
void f( std::invocable auto callback)
{
callback(47);
}
void function_callback(int i)
{
std::cout << i << std::endl;
}
auto lambda_callback = [](int i )
{
std::cout << i << std::endl;
};
int main(int)
{
f(&function_callback);
f(lambda_callback);
}
I am using GCC trunk with -std=c++2a
flag enabled.