Skip to content

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

@RElesgoe

Description

@RElesgoe

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions