Skip to content

json::parse(...) vs json j; j.parse(...) #357

@oneill1979

Description

@oneill1979

I was wondering if there is a reason that a call to parse on a json object just returns a null json object? The same input seems to parse without issue using the jason::parse call.

For example the following program:

{
    std::string input("{\"happy\":true,\"pi\":3.141}");
    json j;
    j.parse(input);
    std::cout << j.dump() << std::endl;
    j=json::parse(input);
    std::cout << j.dump() << std::endl;
}

Results in (osx):

null
{"happy":true,"pi":3.141}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions