Skip to content

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

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

Activity

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

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