Boost logo

Boost :

From: gtpaw (gtpaw_at_[hidden])
Date: 2002-02-13 03:29:48


--- In boost_at_y..., Bill Seymour <bill-at-the-office_at_p...> wrote:
> Itay wrote:
> >
> > std::string s;
> > s = into_string<std::string>() << "current year: " << 2002
<< ".\n";
> >
>
> - How is this better than std::ostringstream?
>

The initial motivation of this 'to_string' thread was to implement an
easy to use wrapper for ostringstream, thus, eliminating the need to
deal with the 'details' of the stream. Naturally, a wrapper cannot
yield more power than what is delivered by the underlying core.

> - If I'm using << operators, can I use I/O manipulators?
>
the 'into_string' interface uses the dedicated into_string_proxy
class. This class isn't derived from std::ios_base so I/O
manipulators cannot co-work with it.

-Itay.


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