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

NLOHMANN_JSON_SERIALIZE_ENUM macro capture's json objects by value #1822

Closed
AnthonyVH opened this issue Oct 30, 2019 · 1 comment
Closed

Comments

@AnthonyVH
Copy link
Contributor

The NLOHMANN_JSON_SERIALIZE_ENUM macro (more specifically the from_json function defined by it), captures a json argument by value.

The specific lambda capture I'm talking about is in detail/macro_scope.hpp, line 100.

This copy can be (micro-)optimized away by capturing by reference instead.

@AnthonyVH
Copy link
Contributor Author

Note: this was changed in #1821. I messed up my pull request somewhat, so it slipped in accidentally.

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

No branches or pull requests

1 participant