Skip to content

Value method with undocumented throwing 302 exception #1601

Description

@lohmanndouglas

I am using value function and I did not figure out if this should be the correct behavior according to the documentation.

The following code terminate called after throwing an instance of [json.exception.type_error.302] type must be string, but is number.

Should I add this throwing to the docs?

int main() 
{
    json json_types =
    {
        {"MyString", "Hello, world!"},
        {"MyInt", 123}
    };   
    std::string string_id;
    json_types.value("MyInt", string_id);
} 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions