From 419ba86a914be2dcbd3ab74b0bcb8b40b907ec7f Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 28 Aug 2021 16:54:58 -0700 Subject: [PATCH] Improve docs --- doc/api.rst | 6 ++++-- include/fmt/core.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 64a8f735..ba0b70c0 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -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 --------------- diff --git a/include/fmt/core.h b/include/fmt/core.h index 476b06eb..6f779e18 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2956,7 +2956,7 @@ template auto runtime(const S& s) -> basic_string_view> { #else template using format_string = basic_format_string...>; -// Creates a runtime format string. +/** Creates a runtime format string. */ template auto runtime(const S& s) -> basic_runtime> { return {{s}}; }