Deprecate legacy make_args_checked
This commit is contained in:
parent
8103144ff8
commit
bdfec1dc88
@ -113,8 +113,7 @@ binary footprint, for example (https://godbolt.org/z/oba4Mc):
|
|||||||
|
|
||||||
template <typename S, typename... Args>
|
template <typename S, typename... Args>
|
||||||
void log(const char* file, int line, const S& format, Args&&... args) {
|
void log(const char* file, int line, const S& format, Args&&... args) {
|
||||||
vlog(file, line, format,
|
vlog(file, line, format, fmt::make_format_args(args...));
|
||||||
fmt::make_args_checked<Args...>(format, args...));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MY_LOG(format, ...) \
|
#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
|
Note that ``vlog`` is not parameterized on argument types which improves compile
|
||||||
times and reduces binary code size compared to a fully parameterized version.
|
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&...)
|
.. doxygenfunction:: fmt::make_format_args(const Args&...)
|
||||||
|
|
||||||
.. doxygenclass:: fmt::format_arg_store
|
.. doxygenclass:: fmt::format_arg_store
|
||||||
|
|||||||
@ -834,8 +834,8 @@ class FMT_API format_error : public std::runtime_error {
|
|||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
template <typename... Args, typename S, typename Char = char_t<S>>
|
template <typename... Args, typename S, typename Char = char_t<S>>
|
||||||
FMT_INLINE auto make_args_checked(const S& fmt,
|
FMT_DEPRECATED FMT_INLINE auto make_args_checked(
|
||||||
const remove_reference_t<Args>&... args)
|
const S& fmt, const remove_reference_t<Args>&... args)
|
||||||
-> format_arg_store<buffer_context<Char>, remove_reference_t<Args>...> {
|
-> format_arg_store<buffer_context<Char>, remove_reference_t<Args>...> {
|
||||||
static_assert(
|
static_assert(
|
||||||
detail::count<(
|
detail::count<(
|
||||||
|
|||||||
@ -195,13 +195,6 @@ TEST(module_test, wformat_args) {
|
|||||||
EXPECT_TRUE(args.get(0));
|
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) {
|
TEST(module_test, dynamic_format_args) {
|
||||||
fmt::dynamic_format_arg_store<fmt::format_context> dyn_store;
|
fmt::dynamic_format_arg_store<fmt::format_context> dyn_store;
|
||||||
dyn_store.push_back(fmt::arg("a42", 42));
|
dyn_store.push_back(fmt::arg("a42", 42));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user