Boost logo

Boost :

From: Martin Fuchs (martin-fuchs_at_[hidden])
Date: 2002-05-30 16:15:32

Andy Glew wrote:

>I suggest supporting the non-positional form with named substitutions,
> with the positional form as a shorthand.

I looked at the boost format library "format.hpp".
It is really pretty complete.

But like Andy I would find it very convenient to add the functionality for
named substitions. Positional parameters are not bad - it's just what
printf does. But if we create a new formating library using C++ we can
even do better.

> Longer odds: COBOL / PL-1's PICture formats (also some Basic)
> are overall more powerful than printf. I'd love to find a C++ library
> that supported PICtures.

Yes - there are many ways to do the same thing "string fromating".
Generations ;-) of programmers had the same problem and did find one or the
other solution.

Another thougt:

By now there's nothing in boost, to do the opposite thing of string
formating -
string scanning like using scanf(), is it?

The main argument for a C++ formating library, I think, is the missing type
safeness of printf()-like functions using ellipse parameters.

The same is true for scanf(). So here a replacement using C++ might be
equally interesting.



Boost list run by bdawes at, gregod at, cpdaniel at, john at