Boost::Serialization Compile error and my temporary solution,

Dear Robert Ramey, I'm SO sorry to bother you again! When I compile Boost::Serialization(version 1.32.0) using msvc71+stlport4.6.2, I fond compile error in the file "xml_escape.hpp" line 47. I followed the way compile shown , and find the cause is in file "xml_woarchive_impl.ipp" line 108 . I think it is more reasonable to alter the function like this : /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_NO_STD_WSTRING template<class Archive> void xml_woarchive_impl<Archive>::save(const std::wstring & ws){ typedef iterators::xml_escape<std::wstring::const_iterator> xmbtows; // This is changed by zhengyi !! otherwise ,using stlport can not // compile successfully std::copy( xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.begin()/*ws.data()*/)), xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.end()/*ws.data() + ws.size()*/)), boost::archive::iterators::ostream_iterator<wchar_t>(os) ); } #endif //BOOST_NO_STD_WSTRING /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// When I using above code instead yours, the compiler seems happy. and when i switch to ms stl ,that's ok. The original code of yours can pass when using ms-stl , but will fail with stlport. Can you explain that ? Do you think the modified code is right ? How Can I build successfully without alter your code(I like stlport and do not want to define macro BOOST_NO_STD_WSTRING to avoid compile error ) ? Thanks for your patience to read this letter! Merry Christmas!! (two days early ^_^) goodmen@x263.net 2004-12-22

I have made the following change in my test copy typedef iterators::xml_escape<const wchar_t *> xmbtows; std::copy( xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data())), xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data() + ws.size())), boost::archive::iterators::ostream_iterator<wchar_t>(os) ); It does compile with VC 7.1 - we'll see how other platforms like it. Robert Ramey zhengyi wrote:
The original code of yours can pass when using ms-stl , but will fail with stlport.
Can you explain that ?
I test with stl_port 4.53 I don't know what the differences are.
Do you think the modified code is right ?
basically yes, it also eliminates a wcslen which is a good thing.
How Can I build successfully without alter your code(I like stlport and do not want to define macro BOOST_NO_STD_WSTRING to avoid compile error ) ?
Just change your personal copy. Any changes made now won't appear in the official boost library until version 1.33 Robert Ramey
participants (2)
-
Robert Ramey
-
zhengyi