Skip to content

Silently get numbers into smaller types #288

@vladimirgamalyan

Description

@vladimirgamalyan

This code:

    json j = { { "foo", 65536 } };
    int16_t v = j["foo"].get<int16_t>();
    std::cout << v << "\n";

prints

0

Probably, it would be better, if get thrown some exception (maybe std::out_of_range).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions