| Home | Libraries | People | FAQ | More

## Class ptree_bad_data

boost::property_tree::ptree_bad_data — Error indicating that translation from given value to the property tree data_type (or vice versa) failed. Derives from ptree_error.

## Synopsis

    // In header: <boost/property_tree/exceptions.hpp>

    class ptree_bad_data : public boost::property_tree::ptree_error {
    public:

      // public member functions
      template<typename T> ptree_bad_data(const std::string &, const T &);
      template<typename T> T data() const;
    };

## Description

### `ptree_bad_data` public member functions

1.     template<typename T> ptree_bad_data(const std::string & what, const T & data);

   Instantiate a ptree_bad_data instance with the given message and data.

   Parameters: |
   `what` | The message to associate with this error.
   `data` | The value associated with this error that was the source of the translation failure.

2.     template<typename T> T data() const;

   Retrieve the data associated with this error. This is the source value that failed to be translated. You need to explicitly specify its type.