Paul Hamilton wrote:

"Peter Dimov" <[EMAIL PROTECTED]> wrote:



This will work, although I had

template<class Tr, class Ch> inline
   void empty_buf(BOOST_IO_STD basic_ostringstream<Ch,Tr> & os) {
       os.str( std::basic_string<Ch, Tr>() );
   }

in mind as it is a smaller change.


This works just fine also:

*** feed_args.hpp.orig Thu Aug 21 22:45:28 2003
--- feed_args.hpp Fri Aug 22 10:19:55 2003
***************
*** 35,40 ****
    template<class Tr, class Ch> inline
    void empty_buf(BOOST_IO_STD basic_ostringstream<Ch,Tr> & os) {
! static const std::basic_string<Ch, Tr> emptyStr;
!     os.str(emptyStr);
    }

--- 35,39 ----
    template<class Tr, class Ch> inline
    void empty_buf(BOOST_IO_STD basic_ostringstream<Ch,Tr> & os) {
!     os.str(std::basic_string<Ch, Tr>());
    }

Paul.



ok, I'll commit that on monday. I had made the empty string as a static variable hoping it could help avoid re-allocating memory for the temporary strings, but it doesnt seem to, so it's best to simplify that anyway.


But, for curiosity, isn't this static-variable in function supposed to work here, according to the standard ?

--
Samuel

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to