Format a String in C++ with the same convenience as String.format() in Java 5 / 6? -
is there common function available able sprintf
type string formatting without having supply fixed size buffer, returns string
class instance?
i know stringstream
doesn't want, i don't want hard code position of tokens in output statement requires.
i want able define pattern sprintf
lets you, without c baggage , in more idiomatic object oriented c++ manner.
maybe function sprintf
using stringstream
, produces string
object? along line of convenience of string.format() in java or equivalent string formatting syntax in python.
the
<boost/format.hpp>
format class providesprintf
-like formatting, in type-safe manner allows output of user-defined types.
Comments
Post a Comment