From 3272a7a3ce3ea5e1f32327f8c70a9573ea8ec406 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 21 Sep 2022 12:03:18 -0700 Subject: [PATCH] Update an example --- doc/api.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 2c9f803f..ea938a1c 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -259,7 +259,7 @@ binary footprint, for example (https://godbolt.org/z/oba4Mc): .. code:: c++ - #include + #include void vlog(const char* file, int line, fmt::string_view format, fmt::format_args args) { @@ -267,13 +267,12 @@ binary footprint, for example (https://godbolt.org/z/oba4Mc): fmt::vprint(format, args); } - template - void log(const char* file, int line, const S& format, Args&&... args) { + template + void log(const char* file, int line, fmt::format_string format, T&&... args) { vlog(file, line, format, fmt::make_format_args(args...)); } - #define MY_LOG(format, ...) \ - log(__FILE__, __LINE__, FMT_STRING(format), __VA_ARGS__) + #define MY_LOG(format, ...) log(__FILE__, __LINE__, format, __VA_ARGS__) MY_LOG("invalid squishiness: {}", 42);