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

Fix compilation error: ambiguous overload #513

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

erikaldsund
Copy link
Contributor

On gcc 5.3.0, you get a compilation error when assigning a lambda
function to a json::wvalue. The compilation error is due to a lambda
function being implicitly convertible to a function pointer, which again
can be implicitly converted to both a bool and a std::function. Avoid
the ambiguity by explicitly casting the lambda to a std::function.

On gcc 5.3.0, you get a compilation error when assigning a lambda
function to a json::wvalue. The compilation error is due to a lambda
function being implicitly convertible to a function pointer, which again
can be implicitly converted to both a bool and a std::function. Avoid
the ambiguity by explicitly casting the lambda to a std::function.
Copy link
Member

@The-EDev The-EDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for noticing this problem and fixing it!

@The-EDev The-EDev merged commit 6e7f0fb into CrowCpp:master Aug 5, 2022
@erikaldsund erikaldsund deleted the cpp11_ambiguity_fix branch August 5, 2022 15:45
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

Successfully merging this pull request may close these issues.

2 participants