From 0fa65cf329ad4348e8673ffe9754e44343501fd8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 16 Mar 2019 07:36:27 -0700 Subject: [PATCH] Add example --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index 69267cb2..b84b053c 100644 --- a/README.rst +++ b/README.rst @@ -64,6 +64,12 @@ Print ``Hello, world!`` to ``stdout``: fmt::print("Hello, {}!", "world"); // uses Python-like format string syntax fmt::printf("Hello, %s!", "world"); // uses printf format string syntax +Format a string and use positional arguments: + +.. code:: c++ + + std::string s = fmt::format("I'd rather be {1} than {0}.", "right", "happy"); + Check a format string at compile time: .. code:: c++