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

Unable to build example for constructing json object with stringstreams #250

Closed
RElesgoe opened this issue May 23, 2016 · 2 comments
Closed
Labels
kind: bug platform: visual studio related to MSVC solution: invalid the issue is not related to the library

Comments

@RElesgoe
Copy link

RElesgoe commented May 23, 2016

http://nlohmann.github.io/json/classnlohmann_1_1basic__json_a9857835334d38ba04959e348ca6be208.html#a9857835334d38ba04959e348ca6be208

  • Visual Studio 2015 Update 2
  • JSON for Modern C++ 1.1.0

Compiler errors:

jsonstream\main.cpp(32): error C2664: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>::basic_json(nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator> &&) noexcept': cannot convert argument 1 from 'std::stringstream' to 'const nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>::value_t'
         jsonstream\jsonstream\main.cpp(32): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

jsonstream\main.cpp(55): error C2664: 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>::basic_json(nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator> &&) noexcept': cannot convert argument 1 from 'std::stringstream' to 'std::initializer_list<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>>'
         jsonstream\jsonstream\main.cpp(55): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

Also unable to pass a std::ifstream object as well.

@nlohmann
Copy link
Owner

Thanks for reporting! Could you please also try the latest version from develop branch?

@RElesgoe
Copy link
Author

Successfully built using commit a3f432b

@nlohmann nlohmann added the solution: invalid the issue is not related to the library label May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug platform: visual studio related to MSVC solution: invalid the issue is not related to the library
Projects
None yet
Development

No branches or pull requests

2 participants