Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2003-04-22 20:11:51


Reece Dunn wrote:
[snip]
>
>> What I want is something as transparent as possible, since usually
>> streams
>> are passed as std::ostream& arguments.
>
>
> My code does not allow for you to pass a std::ostream & to the
> constructor, using something like:
>
> // will *not* work
> boost::indentor< std::ostream > ind( os );
>
The marg_ostream CTOR can take a std::ostream argument. It's located
in files/col_io directory. I don't think there's any way to more transparent
because some method call for changing the indentation is needed. You could
change the cout streambuf* to marg_ostreambuf* (also defined in files/col_io)
but then you'd have to call cout.rd_buf and static_cast it to marg_ostreambuf
before calling a method to change the margin. The two files,
main.cpp and main.exp in the files/col_io directory shows a test of this.
The marg_ostream test is in the .zip file.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk