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

Issue iterating through 'items' #3021

Closed
ZacharyLowell opened this issue Sep 17, 2021 · 5 comments
Closed

Issue iterating through 'items' #3021

ZacharyLowell opened this issue Sep 17, 2021 · 5 comments
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation state: needs more info the author of the issue needs to provide more details

Comments

@ZacharyLowell
Copy link

When trying to compile my code, I am getting the following error:


XXX.cpp:128:44: error: ‘using value_type = class nlohmann::basic_json<>’ {aka ‘class nlohmann::basic_json<>’} has no member named ‘items’
for(auto& el: _pc["XX"]["XXXXX"].items()){


Prior to running this, I ran a sudo apt-get install nlohmann-json-dev. Any solution other than using the json.hpp header?

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Sep 18, 2021
@nlohmann
Copy link
Owner

Which version are you using?

@nlohmann
Copy link
Owner

The items() function has been added in version 3.0.0 - it seems you are using an older version of the library. You can find out which version you are using with meta() (see https://json.nlohmann.me/api/basic_json/meta/).

@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed kind: bug labels Sep 20, 2021
@ZacharyLowell
Copy link
Author

Sounds good. I will update to the most recent version. I'm using Linux and figured the apt-get install nlohmann-json-dev would be the most up to date version, but I guess not.

@nlohmann
Copy link
Owner

nlohmann commented Oct 3, 2021

Do you need further assistance with this issue?

@ZacharyLowell
Copy link
Author

No I do not. Thank you

@nlohmann nlohmann closed this as completed Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

2 participants