Boost logo

Boost Users :

Subject: [Boost-users] [property_tree] Failure with Boost 1.56
From: beet (r.berlich_at_[hidden])
Date: 2014-08-11 14:17:26


Dear all,

with the release of Boost 1.56, on Ubuntu 14.04 (g++ 4.8.2, 64 bit),
code like the following suddenly fails to compile:

pt::xml_writer_settings<char> settings('\t', 1);
pt::write_xml(someFileName, ptr_out, std::locale(), settings);

"pt" is obviously an alias for boost::property_tree. The error message
I'm getting is

/opt/boost156/include/boost/property_tree/detail/xml_parser_writer_settings.hpp:38:35:
error: 'char' is not a class, struct, or union type
  typedef typename Str::value_type Ch;

I can see the following possibly relevant change in property_tree:

In Boost 1.55, from xml_parser.hpp:
-----------------------------------

template<typename Ptree>
void write_xml(
  const std::string &
  , const Ptree &
  , const std::locale & = std::locale()
  , const xml_writer_settings<typename Ptree::key_type::value_type >& =
xml_writer_settings<typename Ptree::key_type::value_type >()
);

In Boost 1.56, same header:
---------------------------

template<typename Ptree>
void write_xml(
  const std::string &
  , const Ptree &
  , const std::locale & = std::locale()
  , const xml_writer_settings<typename Ptree::key_type > &
= xml_writer_settings<typename Ptree::key_type >()
);

So xml_writer_settings is now given a Ptree::key_type instead of a
Ptree::key_type::value_type which I assume is the reason for the above
error.

Is there a portable way to specify the type of indention character in
write_xml ?

Best Regards,
Beet


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net