Deprecate legacy make_args_checked

This commit is contained in:
Vladislav Shchapov 2022-02-10 01:06:10 +05:00
parent 8103144ff8
commit bdfec1dc88
3 changed files with 3 additions and 13 deletions

View File

@ -113,8 +113,7 @@ binary footprint, for example (https://godbolt.org/z/oba4Mc):
template <typename S, typename... Args>
void log(const char* file, int line, const S& format, Args&&... args) {
vlog(file, line, format,
fmt::make_args_checked<Args...>(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<Args>&...)
.. doxygenfunction:: fmt::make_format_args(const Args&...)
.. doxygenclass:: fmt::format_arg_store

View File

@ -834,8 +834,8 @@ class FMT_API format_error : public std::runtime_error {
\endrst
*/
template <typename... Args, typename S, typename Char = char_t<S>>
FMT_INLINE auto make_args_checked(const S& fmt,
const remove_reference_t<Args>&... args)
FMT_DEPRECATED FMT_INLINE auto make_args_checked(
const S& fmt, const remove_reference_t<Args>&... args)
-> format_arg_store<buffer_context<Char>, remove_reference_t<Args>...> {
static_assert(
detail::count<(

View File

@ -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<int>("{}", 42);
EXPECT_TRUE(args.get(0));
fmt::basic_format_args wargs = fmt::make_args_checked<int>(L"{}", 42);
EXPECT_TRUE(wargs.get(0));
}
TEST(module_test, dynamic_format_args) {
fmt::dynamic_format_arg_store<fmt::format_context> dyn_store;
dyn_store.push_back(fmt::arg("a42", 42));