-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Passing an iteration object by reference to a function #967
Comments
+1 |
One problem is that you're mixing references and pointers. Your |
You can use the However, the library does not store integers as You could template your |
@J-e-r-e-m-i-a-h Do you need further assistance? |
The example is wrong, by the way; the As of now, I'm trying to figure it out, I'll let you know if I can't figure out how to use get_ref :P I'm pretty sure your proposed solution is correct. Here's what I've got so far, let me know if I'm on the right track :)
|
Looks right. |
All is good then! Thanks for the help! I love this resource, absolutely amazing. |
Bug Report
What is the issue you have?
I cannot pass a JSON iteration object by reference to a function
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
To be able to pass the object by reference, rather than this:
And what is the actual behavior instead?
Error (active) E0167 argument of type "nlohmann::basic_json<std::map, std::vector, std::string, bool, int64_t, uint64_t, double, std::allocator, nlohmann::adl_serializer> *" is incompatible with parameter of type "int *"
Which compiler and operating system are you using? Is it a supported compiler?
Visual Studio 2017 15.5.3, Windows 10
Did you use a released version of the library or the version from the
develop
branch?Released
If you experience a compilation error: can you compile and run the unit tests?
Yes
The text was updated successfully, but these errors were encountered: