Boost logo

Boost :

From: Karl Nelson (kenelson_at_[hidden])
Date: 2002-01-31 12:28:03

Updated the submission to incorperate suggested improvements.

  * 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

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?

Should formating of int and float be in iostream instead
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'.


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