From 1a236c80f312c965799801c97034711207478e73 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 6 Sep 2013 15:12:46 -0700 Subject: [PATCH] Add an example. --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 714c5cbd..62c35530 100644 --- a/README.rst +++ b/README.rst @@ -54,6 +54,13 @@ Arguments can be accessed by position and arguments' indices can be repeated: std::string s = str(fmt::Format("{0}{1}{0}") << "abra" << "cad"); // s == "abracadabra" +Format can be used as a safe portable replacement to ``itoa``: + +.. code-block:: c++ + + fmt::Writer w; + w << 42; // replaces itoa(42, buffer, 10) + An object of any user-defined type for which there is an overloaded :code:`std::ostream` insertion operator (``operator<<``) can be formatted: