Commit 1aaf72fb authored by Victor Zverovich's avatar Victor Zverovich

Add an example to fmt::runtime

parent c1313c20
...@@ -2956,7 +2956,16 @@ template <typename S> auto runtime(const S& s) -> basic_string_view<char_t<S>> { ...@@ -2956,7 +2956,16 @@ 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. */ /**
\rst
Creates a runtime format string.
**Example**::
// Check format string at runtime instead of compile-time.
fmt::print(fmt::runtime("{:d}"), "I am not a number");
\endrst
*/
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}};
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment