>From: "Larry Evans" <[EMAIL PROTECTED]> > Terje Slettebų wrote: > >>From: "Vladimir Prus" <[EMAIL PROTECTED]> > > > >>Terje Slettebų wrote: > > [snip] > > > > std::cout << io_format<char (&)[3]>("\n|","|\n","|") > > << io_format<char (&)[3][3]>("-------","-------","-------") > > << board << '\n'; > > } > > > > we get: > > > > ------- > > |O|X|O| > > ------- > > |X|X|O| > > ------- > > |O|O|X| > > ------- > > I've used marg_ostream to format output for containers; however, > it only used something that changed the margin. I had to > use an ostream<< for the particular composite to get it to work. > However, being able to adjust the margin seems useful for > formating most code. Looking at the code might give you > some more ideas about your io_format. Unfortunately, marg_ostream > requires wrapping the cout in a marg_ostream. > > Anyhow, the code is in boost files in shared_cyclic_ptr/shared_cyclic_ptr.zip > in boost/col_io directory. Basically, marg_ostream++ increments the > margin and marg_ostream-- decrements the margin. You can also specify > what's in the margin. This was used to show the nesting in a fortran > program in a parallelizing compiler.
Thanks for the tip. I'll look into it. Regards, Terje _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost