|
Boost Users : |
Subject: [Boost-users] It seems a bug in boost::property_tree when I use custom allocator.
From: SONGFY (911songfeiyu_at_[hidden])
Date: 2010-12-29 01:47:33
I use custom stl allocator to replace std::basic_string like this:
typedef std::basic_string<char, std::char_traits<char>, MySTLAllocator<char> > MyString;
I want basic_ptree can use my allocator to do parse work, so I write code like this:
typedef boost::property_tree::basic_ptree<MyString, MyString> PropertyTree;
PropertyTree propertyTree;
boost::property_tree::read_ini(std::ifstream(configFile.c_str()), propertyTree);
And I met error at ini_parser.hpp, line 109~111:
Str key = property_tree::detail::trim(
line.substr(1, end - 1), stream.getloc());
if (local.find(key) != local.not_found())
the Str is a typedef at the begin of this function:
typedef std::basic_string<Ch> Str;
So my custom string can not assign to the key, so it seems can not use custom allocator at all. There have the same problem in xml_parser.
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