Boost logo

Boost :

From: rogeeff (rogeeff_at_[hidden])
Date: 2002-01-31 12:56:33


--- In boost_at_y..., Karl Nelson <kenelson_at_e...> wrote:
>
> Updated the submission to incorperate suggested improvements.
>
> Changes
> * supports positional only for those to lazy to
> write "%1$s"
> cout << format("I have %1% %2%.", num_items, item_type);
>
> * switched __ to _p_ to meet standard.
> * moved internals to directory.
> * changed headers to hpp.
> * macrod group.
> * switched group to take by value for "hex"
>
> Unanswered questions:
>
> Should it try to support all of printf output options or
> simply support that which iostreams allow and eat them for
> compatiblity?
>
> Should non-iostream things like truncate be affectable
> by manipulators?
>
> Does cout << format("%#010x" , complex<int>(20,21) ); mean
> A) the user wants all integers output to be show base with
> 12 charactors zero padded. 0x00000016+0x00000017i
> B) The total width should be 10 with showbase and zero padding?
> 0x16+0x17i
> ?
>
> Should formating of int and float be in iostream instead
> Ie.
> os.float_format("##.####");
> os.int_format("0x0######",hex);
> rather than the simple state machine?
>
>
> Suggestions not yet incorperated.
> - Checking for too many parameters.
>
> - The following should silently swallow the "foo" argument:
>
> cout << format("%2$s", "foo", "bar");
>
> Right now, it invokes undefined behavior.
>
> - 'bad_format_string' should derive from 'std::exception'.
>
> --Karl

Now I am really congused. How many format libraries do we need? Since
I am not an expect in this area I can't make sound analisys which
approach is better, but can't "format guys" come to some consensus
and present one solution? Again I have nothing against the
submittion, but I do not want to end up like Buridan's donkey.

Gennadiy.


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