Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2005-03-30 09:30:15


On Wed, 30 Mar 2005 17:35:12 +0400, Vladimir Prus <ghost_at_[hidden]> wrote:

> 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.

Is the free-function syntax

   str (format (...))

more palatable?

-- 
Caleb Epstein
caleb dot epstein at gmail dot com

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