Skip to content

Commit

Permalink
Deprecate legacy make_args_checked
Browse files Browse the repository at this point in the history
  • Loading branch information
phprus committed Feb 13, 2022
1 parent 8103144 commit bdfec1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
5 changes: 1 addition & 4 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...) \
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<(
Expand Down
7 changes: 0 additions & 7 deletions test/module-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit bdfec1d

Please sign in to comment.