Opened 10 years ago

Closed 8 years ago

#7615 closed Bugs (fixed)

use property_tree::ptree.get<char>() for MSVC

Reported by: shirshov evgeny <381677383@…> Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost 1.52.0 Severity: Problem
Keywords: property_tree Cc: shirshov, evgeny, <381677383@…>

Description

error : not exception "ptree_bad_data" compiler MSVC 10.

    ptree pt;
    pt.put<int>("a",1000000);
    try
    {
        pt.get<unsigned char>("a");
        // !!! bug !!!
        BOOST_ERROR("No required exception thrown");
    }
    catch (boost::property_tree::ptree_bad_data &) { }
    catch (...)
    {
        BOOST_ERROR("Wrong exception type thrown");
    }

Attachments (2)

stream_translator.hpp.patch (771 bytes ) - added by shirshov evgeny <381677383@…> 10 years ago.
patch
boost_test.cpp (752 bytes ) - added by shirshov evgeny <381677383@…> 10 years ago.
unit test

Download all attachments as: .zip

Change History (5)

by shirshov evgeny <381677383@…>, 10 years ago

Attachment: stream_translator.hpp.patch added

patch

by shirshov evgeny <381677383@…>, 10 years ago

Attachment: boost_test.cpp added

unit test

comment:1 by jbartosch@…, 10 years ago

Keywords: property_tree added; property_three removed

edit: Changed misspelled keyword (property_three to property_tree) to possibly help visibility.

I just spend a few hours tracking down this problem in a program I'm working on. Would be great to see this fix included in a release soon. As it is, I can't use uint8_t with property_tree.

comment:2 by Sebastian Redl, 8 years ago

Cc: shirshov evgeny <381677383@…> added; shirshov evgeny <381677383@…> removed
Status: newassigned

Fixed on develop in commit #bf1e1b1.

comment:3 by Sebastian Redl, 8 years ago

Resolution: fixed
Status: assignedclosed

Merged to master in commit 3befb8cbe4.

Note: See TracTickets for help on using tickets.