Boost logo

Boost :

From: Joerg Baumann (Joerg.Baumann_at_[hidden])
Date: 2002-07-14 19:43:29


Hi,

I know there is already lexical_cast for converting from/to
textual representations and I'm aware of the discussions on format(),
but wouldn't it be (sometimes) convenient if something like this
would work:

  void f(const std::string& s);

  ...

  f(ext::make_string()
    << std::string("strange")
    << "Warning #" << std::setfill('0') << std::setw(4) << 42 << ":"
    << std::endl << " " << std::string("Address ") << &dummy
    << " is out of range!");

I have a first proof-of-concept implementation.
Basically it's just a safe way for the evil
"(ostringstream() << var).str()".

I don't want to start a flame-war between iostream fanatics and haters.
It's just a another solution for the problem.

If someone thinks this could be useful, I will but more work into it
and try to make it usable. So comments and suggestions are welcome ;-)

Regards,
  joerg


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