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

Reading ordered_json from file causes compile error #2331

Closed
2 of 5 tasks
jin-clova opened this issue Jul 31, 2020 · 1 comment · Fixed by #2319
Closed
2 of 5 tasks

Reading ordered_json from file causes compile error #2331

jin-clova opened this issue Jul 31, 2020 · 1 comment · Fixed by #2319
Assignees
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@jin-clova
Copy link

What is the issue you have?

Code below is causing compilation error.

    std::ifstream i(path);
    ordered_json j;
    i >> j;

(20462, 53) No viable conversion from 'typename basic_json<nlohmann::ordered_map, std::vector, basic_string, bool, long long, unsigned long long, double, std::allocator, adl_serializer, vector<unsigned char, allocator > >::object_t::iterator' (aka '__wrap_iter<std::__1::pair<const std::__1::basic_string, nlohmann::basic_json<nlohmann::ordered_map, std::vector, std::__1::basic_string, bool, long long, unsigned long long, double, std::allocator, adl_serializer, std::__1::vector<unsigned char, std::__1::allocator > > > *>') to 'const std::__1::basic_string'

Please describe the steps to reproduce the issue.

  1. Write the code above.
  2. Try build
  3. Boom!

Can you provide a small but working code example?

It's not working, but see above for the code.

What is the expected behavior?

Successfully built, and read the json file.

And what is the actual behavior instead?

Compile error

Which compiler and operating system are you using?

  • Compiler: xcode
  • Operating system: mac

Which version of the library did you use?

  • latest release version 3.9.0
  • other release - please state the version: ___
  • the develop branch

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below

I can compile this project and pass all unit tests, but I don't think the tests cover this case.

@nlohmann
Copy link
Owner

This is fixed with #2319.

@nlohmann nlohmann added confirmed solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Jul 31, 2020
@nlohmann nlohmann self-assigned this Jul 31, 2020
@nlohmann nlohmann added this to the Release 3.9.1 milestone Jul 31, 2020
@nlohmann nlohmann linked a pull request Jul 31, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants