Boost logo

Boost :

From: Ross Smith (r-smith_at_[hidden])
Date: 2002-01-31 01:44:12


Samuel Krempp wrote:
>
> On Thu, 2002-01-31 at 00:39, Karl Nelson wrote:
> > Because most people have no liked use of an operator like << and %,
> > I have switched to a printf style for up to 9 arguments. Ie.
> >
> > cout << format("%s, %s %d, %d:%.2d\n", weekday, month, day, hour, min);
>
> This is also my favorite.
> except, of course, the 9-arguments limitation makes the C++ equivalent
> to C's printf look miserable.
> (even 100-arguments)
>
> if not for that, I would also have made operator% a member function, say
> 'with(..)', and provide dozens of N-ary constructors, calling with(..)
> on each argument.

I'll repeat the suggestion I made a while ago:

cout << format("%s, %s %d, %d:%.2d\n")(weekday)(month)(day)(hour)(min);

-- 
Ross Smith ...................................... Auckland, New Zealand
r-smith_at_[hidden] ......................... http://storm.net.nz/~ross/
  "We need a new cosmology. New gods. New sacraments. Another drink."
                                                       -- Patti Smith

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