Skip to content

Getting unsigned of value with negative number should throw a ptree_bad_data #120

@Pokawa

Description

@Pokawa

As of now ptree will not complain about a negative value and will happily cast it to unsigned type. If that's expected then I think it's highly unintuitive.

    boost::property_tree::ptree pt;
    pt.put("foo", "-1");
    std::cout << pt.get<unsigned>("foo") << std::endl; // 4294967295

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions