Skip to content

cpp error lambda to func& #903

New issue

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

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

Already on GitHub? # to your account

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);
}

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

No branches or pull requests

2 participants