Improve docs

This commit is contained in:
Victor Zverovich 2021-08-28 16:54:58 -07:00
parent 6a5b4d5faf
commit 419ba86a91
2 changed files with 5 additions and 3 deletions

View File

@ -42,9 +42,9 @@ surrounded by braces ``{}``. The fields are replaced with formatted arguments
in the resulting string. A function taking *fmt* doesn't participate in an
overload resolution if the latter is not a string.
Most formatting functions such as ``fmt::format`` require a format string to
Most formatting functions such as `fmt::format` require a format string to
be known at compile time, i.e. be a string literal or a ``constexpr`` string.
To pass a runtime format string wrap it in ``fmt::runtime``.
To pass a runtime format string wrap it in `fmt::runtime`.
*args* is an argument list representing objects to be formatted.
@ -87,6 +87,8 @@ formatting is still possible using ``fmt::vformat``, ``fmt::vprint``, etc.
.. doxygentypedef:: fmt::format_string
.. doxygenfunction:: fmt::runtime(const S&)
Named Arguments
---------------

View File

@ -2956,7 +2956,7 @@ template <typename S> auto runtime(const S& s) -> basic_string_view<char_t<S>> {
#else
template <typename... Args>
using format_string = basic_format_string<char, type_identity_t<Args>...>;
// Creates a runtime format string.
/** Creates a runtime format string. */
template <typename S> auto runtime(const S& s) -> basic_runtime<char_t<S>> {
return {{s}};
}