It seems a bug in boost::property_tree when I use custom allocator.

I use custom stl allocator to replace std::basic_string like this:
typedef std::basic_string

On Wed, 29 Dec 2010 07:47:33 +0100, SONGFY <911songfeiyu@163.com> wrote:
I use custom stl allocator to replace std::basic_string like this: typedef std::basic_string
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 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.
Can you try changing the typedef to:
typedef std::basic_string
participants (2)
-
Boris Schaeling
-
SONGFY