Main Page | Modules | Namespace List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

stream simplifications
[C++ std lib enhancements]


Variables

Internal::add_fill_s tag::add_fill
Internal::like_print_s tag::print
Internal::no_space_s tag::no_space

Detailed Description

This group contains two sets of enhancements for using the output streams in the standard library.

The first is a set of additional modifiers for use with the standard << operator. See add_fill , no_space and print for more details.

The second set introduces a new syntax using the comma operator for streams. It creates simple statements similar to print in Python or other languages. The stream object and any values to be printed are written as a comma separated list. Between the values printed, the stream's fill character is output to delimit values. Some examples:

cout, 12, \"hello\", 13, endl;
cout, setfill('|');
cout, 12, 13, 14, endl;
will result in the following output
12 hello 13
12|13|14
endl is treated specially and no separator is produced before or after it. Other iomanips are not treated specially and produce a fill character before their position (if they are not the first in the list).

Variable Documentation

struct Internal::add_fill_s tag::add_fill [static]
 

Ostream modifier which puts spaces between elements using the fill character. endl is treated specially, so a space is not put after an endl

cout << add_fill << 1 << 2 << 3 << endl << 4<< 5 << endl;
This will print:
1 2 3
5 4

struct Internal::no_space_s tag::no_space [static]
 

An ostream modifier to use with print and add_fill which prevents a space being added before the next element.

cout << @ref add_fill  << 0 << 1 << no_space << 2 << 3 << endl;
will print:
0 12 3

struct Internal::like_print_s tag::print [static]
 

Ostream modifier similar to add_fill, except that an endl is added at the end automatically

cout << print << 1 << 2 << 3;
cout << "hello" << endl;
Will print:
1 2 3
hello


Generated on Wed Aug 8 14:30:36 2007 for TooN Algorithm Library - tag by  doxygen 1.3.9.1