Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-03-30 08:35:12


Hello!
While it's generally considered a bad practice to provide implicit
conversions, I think it would be good to provide such a conversion for the
boost::format class. Currently, I can't write:

  string s;
  s = format("%1%") % 10;

and need to write

  s = (format("%1%") % 10).str();

Maybe it's specifics of my code, but I can count 10 such conversions in a
single source file. I think that:

1. Calling .str() is rather inconvenient.
2. The 'format' class most often used inside expressions. It's not likely to
be passed around to functions and so the dangers of implicit conversions are
not critical.

Thoughts?

- Volodya


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