Boost C++ Libraries

...one 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 for the latest Boost documentation.
PrevUpHomeNext

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:
  // construct/copy/destruct
  template<typename T> ptree_bad_data(const std::string &, const T &);
  ~ptree_bad_data();

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

Description

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.

    Parameters:

    data

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

    what

    The message to associate with this error.

  2. ~ptree_bad_data();

ptree_bad_data public member functions

  1. 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.

PrevUpHomeNext