diff --git a/doc/api.rst b/doc/api.rst index 51112b0a..4d72a5cb 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -39,12 +39,10 @@ They take *fmt* and *args* as arguments. *fmt* is a format string that contains literal text and replacement fields 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 -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`. +in the resulting string. `fmt::format_string` is a format string which can be +constructed from a string literal or a ``constexpr`` string and is checked at +compile time in C++20. To pass a runtime format string wrap it in +`fmt::runtime`. *args* is an argument list representing objects to be formatted. diff --git a/include/fmt/core.h b/include/fmt/core.h index 6f779e18..af521e19 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2972,7 +2972,7 @@ FMT_API auto vformat(string_view fmt, format_args args) -> std::string; **Example**:: #include - std::string message = fmt::format("The answer is {}", 42); + std::string message = fmt::format("The answer is {}.", 42); \endrst */ template