From bdfec1dc88cbcdeb7381f373f15907e0a8fc13fd Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Thu, 10 Feb 2022 01:06:10 +0500 Subject: [PATCH] Deprecate legacy make_args_checked --- doc/api.rst | 5 +---- include/fmt/format.h | 4 ++-- test/module-test.cc | 7 ------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 46070ed6..5f7cba51 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -113,8 +113,7 @@ binary footprint, for example (https://godbolt.org/z/oba4Mc): template void log(const char* file, int line, const S& format, Args&&... args) { - vlog(file, line, format, - fmt::make_args_checked(format, args...)); + vlog(file, line, format, fmt::make_format_args(args...)); } #define MY_LOG(format, ...) \ @@ -125,8 +124,6 @@ binary footprint, for example (https://godbolt.org/z/oba4Mc): Note that ``vlog`` is not parameterized on argument types which improves compile times and reduces binary code size compared to a fully parameterized version. -.. doxygenfunction:: fmt::make_args_checked(const S&, const remove_reference_t&...) - .. doxygenfunction:: fmt::make_format_args(const Args&...) .. doxygenclass:: fmt::format_arg_store diff --git a/include/fmt/format.h b/include/fmt/format.h index 79f2c943..99d1af6d 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -834,8 +834,8 @@ class FMT_API format_error : public std::runtime_error { \endrst */ template > -FMT_INLINE auto make_args_checked(const S& fmt, - const remove_reference_t&... args) +FMT_DEPRECATED FMT_INLINE auto make_args_checked( + const S& fmt, const remove_reference_t&... args) -> format_arg_store, remove_reference_t...> { static_assert( detail::count<( diff --git a/test/module-test.cc b/test/module-test.cc index 7fbf763d..62e5fe8b 100644 --- a/test/module-test.cc +++ b/test/module-test.cc @@ -195,13 +195,6 @@ TEST(module_test, wformat_args) { EXPECT_TRUE(args.get(0)); } -TEST(module_test, checked_format_args) { - fmt::basic_format_args args = fmt::make_args_checked("{}", 42); - EXPECT_TRUE(args.get(0)); - fmt::basic_format_args wargs = fmt::make_args_checked(L"{}", 42); - EXPECT_TRUE(wargs.get(0)); -} - TEST(module_test, dynamic_format_args) { fmt::dynamic_format_arg_store dyn_store; dyn_store.push_back(fmt::arg("a42", 42));