Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp error lambda to func& #903

Closed
GilbertoTheMighty opened this issue Jun 25, 2022 · 1 comment
Closed

cpp error lambda to func& #903

GilbertoTheMighty opened this issue Jun 25, 2022 · 1 comment

Comments

@GilbertoTheMighty
Copy link

GilbertoTheMighty commented Jun 25, 2022

Hello, generated headers for cpp produce code:
void skip() { noEntries().forEach([](NoEntries &e){ e.skip(); }); }
which produces compilation error:
void data::NoEntries::forEach<data::skip::<lambda_1>>(Func &)': cannot convert argument 1 from 'data::skip::<lambda_1>' to 'Func &

I'm using VisualStudo2022 with msbuild, ISO C++ 20 Standard

@GilbertoTheMighty
Copy link
Author

GilbertoTheMighty commented Jun 25, 2022

"stackoverflow solution"

#include <functional>
std::function<void(NoEntries&)> lambda = [](NoEntries& e) { e.skip(); };

void skip()
{
    noEntries().forEach(lambda);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants