Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

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.


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

class ptree_bad_data : public boost::property_tree::ptree_error {
  // construct/copy/destruct
  template<typename T> ptree_bad_data(const std::string &, const T &);

  // public member functions
  template<typename T> T data();


ptree_bad_data public construct/copy/destruct

  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.



    The value associated with this error that was the source of the translation failure.


    The message to associate with this error.

  2. ~ptree_bad_data();

ptree_bad_data public member functions

  1. template<typename T> T data();
    Retrieve the data associated with this error. This is the source value that failed to be translated.