O
Oliver Schoenborn
alpha version of coutf library available at
http://noptrlib.sf.net/utils/coutf/
It provides printf-like output to streams (similar to boost::format):
- almost identical to using printf
- fast and simple, provides all essential aspect of printf formatting,
and more (type safety, object output, etc)
- almost no performance hit compared to direct output to std:streams
- holds in one short header file, so no linking etc
Compared to boost::format it is
- more function-like, easier to read, much faster
- but not as comprehensive (e.g. no padding, no support for wchar_t (yet))
- holds in one short header file, no dependencies on boost
Example:
std::string name = "foo";
Time time; // defaults to current time
const float radius=560.456; // approx. m
coutf("Out: %s %s %4.1fs", name, time, radius, endl);
prints to std::cout
Out: foo 12:30pm 560.5 (newline and flush)
Have fun!
Oliver
http://noptrlib.sf.net/utils/coutf/
It provides printf-like output to streams (similar to boost::format):
- almost identical to using printf
- fast and simple, provides all essential aspect of printf formatting,
and more (type safety, object output, etc)
- almost no performance hit compared to direct output to std:streams
- holds in one short header file, so no linking etc
Compared to boost::format it is
- more function-like, easier to read, much faster
- but not as comprehensive (e.g. no padding, no support for wchar_t (yet))
- holds in one short header file, no dependencies on boost
Example:
std::string name = "foo";
Time time; // defaults to current time
const float radius=560.456; // approx. m
coutf("Out: %s %s %4.1fs", name, time, radius, endl);
prints to std::cout
Out: foo 12:30pm 560.5 (newline and flush)
Have fun!
Oliver