Re: [Boost-bugs] [Boost C++ Libraries] #1480: Boost:::Spirit bug in tree_to_xml.ipp

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1480: Boost:::Spirit bug in tree_to_xml.ipp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-11-29 10:15:01


#1480: Boost:::Spirit bug in tree_to_xml.ipp
-------------------------------+--------------------------------------------
  Reporter: anonymous | Owner: hkaiser
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: spirit
   Version: Boost 1.34.1 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Comment (by rkudiyarov_at_[hidden]):

 Problem is not in test case, I suppose that it is in specialization
 template
 string_lit by wchar_t. Method static std::wstring get(char const* source
 = "") should have line[[BR]]
 result.get()[len] = '\0';[[BR]]
 after memory allocation by new, because constructor of string, which
 returned, evaluate incorrect size;
         static std::wstring get(char const* source = "")
         {
             typedef std::ctype<wchar_t> ctype_t;

             using namespace std; // some systems have size_t in ns
 std
             size_t len = strlen(source);
             std::auto_ptr<wchar_t> result (new wchar_t[len+1]);
             std::use_facet<ctype_t>(std::locale())
                 .widen(source, source + len, result.get());

             return result.get();
         }

 But code with using tree_to_xml don`t compile if not fix constructor`s of
 following classes: document, comment, text, node, element.

 I attached correct file(tree_to_xml.ipp) in my report above.
 -- Best Regards, Kudiyarov Roman.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1480#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC