• Home
  • Raw
  • Download

Lines Matching +full:clang +full:- +full:format +full:- +full:3

4 **fmt** (formerly cppformat) is an open-source formatting library.
10 <div class="panel panel-default">
11 <div class="panel-heading">What users say:</div>
12 <div class="panel-body">
14 time. I’ve used both boost::format and loki::SPrintf, and neither felt
19 .. _format-api:
21 Format API
22 ----------
24 The replacement-based Format API provides a safe alternative to ``printf``,
26 <http://zverovich.net/2013/09/07/integer-to-string-conversion-in-cplusplus.html>`_.
27 The `format string syntax <syntax.html>`_ is similar to the one used by
28 `str.format <http://docs.python.org/2/library/stdtypes.html#str.format>`_
33 fmt::format("The answer is {}", 42);
35 The ``fmt::format`` function returns a string "The answer is 42". You can use
62 The Format API also supports positional arguments useful for localization:
76 If your compiler supports C++11 user-defined literals, the suffix ``_a`` offers
84 The ``_format`` suffix may be used to format string literals similar to Python:
90 Other than the placement of the format string on the left of the operator,
91 ``_format`` is functionally identical to ``fmt::format``. In order to use the
96 .. _write-api:
99 ---------
101 The concatenation-based Write API (experimental) provides a `fast
102 <http://zverovich.net/2013/09/07/integer-to-string-conversion-in-cplusplus.html>`_
113 ------
116 overflow, errors in format strings are reported using exceptions. For example,
121 fmt::format("The answer is {:d}", "forty-two");
124 "unknown format code 'd' for string", because the argument
125 ``"forty-two"`` is a string while the format code ``d``
132 fmt::format("Cyrillic letter {}", L'\x42e');
134 produces a compile-time error because wide character ``L'\x42e'`` cannot be
135 formatted into a narrow string. You can use a wide format string instead:
139 fmt::format(L"Cyrillic letter {}", L'\x42e');
149 -----------
154 * 64-bit (amd64) GNU/Linux with GCC 4.4.3,
155 `4.6.3 <https://travis-ci.org/fmtlib/fmt>`_, 4.7.2, 4.8.1, and Intel C++
158 * 32-bit (i386) GNU/Linux with GCC 4.4.3, 4.6.3
160 * Mac OS X with GCC 4.2.1 and Clang 4.2, 5.1.0
162 * 64-bit Windows with Visual C++ 2010, 2013 and
165 * 32-bit Windows with Visual C++ 2010
171 * Variadic templates: minimum GCC 4.4, Clang 2.9 or VS2013. This feature allows
172 the Format API to accept an unlimited number of arguments. With older
175 * User-defined literals: minimum GCC 4.7, Clang 3.1 or VS2015. The suffixes
177 ``fmt::format`` and ``fmt::arg``.
180 particular, formatting a floating-point infinity always gives ``inf`` while the
181 output of ``printf`` is platform-dependent in this case. For example,
189 .. _ease-of-use:
192 -----------
194 fmt has a small self-contained code base with the core library consisting of
197 using the library both in open-source and commercial projects.
201 <a class="btn btn-success" href="https://github.com/fmtlib/fmt">GitHub Repository</a>
204 …<iframe src="http://ghbtns.com/github-btn.html?user=fmtlib&amp;repo=fmt&amp;type=watch&amp;count=t…
205 class="github-btn" width="100" height="20"></iframe>