On Friday 18 January 2002 3:37 pm, Jean-Marc Lasgouttes wrote: > >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes: > > Angus> That's ostringstream and std::string of course. > > I had to use lyxstring with cxx 6.2, due to a wrong assert in its > string implementation. > > Angus> I have no idea what's going wrong. This little program works > Angus> fine! A > > But then of course the code you propose is a bit strange... Could you > try to add a << std::flush, or whatever could put the string in a > 'good' state.
Sorry. You've lost me. Do you mean my 5-line program is strange or the patch to LaTeXFeatures? Where do you want me to add the std::flush? Why does the top bit of code work, but not the bottom one? int main() { std::ostringstream os; os << std::string("Angus\nAngus\nAngus"); std::cerr << os.str().c_str() << std::endl; return 0; } string const LaTeXFeatures::getTClassPreamble() const { LyXTextClass const & tclass = textclasslist.TextClass(params.textclass); ostringstream tcpreamble; tcpreamble << tclass.preamble(); for (layout_type i = 0; i < tclass.numLayouts(); ++i) { tcpreamble << tclass[i].preamble(); } std::cerr << tcpreamble.str().c_str() << std::endl; return tcpreamble.str().c_str(); }