mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Improve docs
This commit is contained in:
@ -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
|
in the resulting string. A function taking *fmt* doesn't participate in an
|
||||||
overload resolution if the latter is not a string.
|
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.
|
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.
|
*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
|
.. doxygentypedef:: fmt::format_string
|
||||||
|
|
||||||
|
.. doxygenfunction:: fmt::runtime(const S&)
|
||||||
|
|
||||||
Named Arguments
|
Named Arguments
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
@ -2956,7 +2956,7 @@ template <typename S> auto runtime(const S& s) -> basic_string_view<char_t<S>> {
|
|||||||
#else
|
#else
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
using format_string = basic_format_string<char, type_identity_t<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>> {
|
template <typename S> auto runtime(const S& s) -> basic_runtime<char_t<S>> {
|
||||||
return {{s}};
|
return {{s}};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user