Skip to content

Commit fa526b4

Browse files
committed
Remove deprecated APIs
1 parent 556c417 commit fa526b4

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

ChangeLog.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,17 @@
7474
formatters (https://github.com/fmtlib/fmt/issues/4424,
7575
https://github.com/fmtlib/fmt/pull/4434). Thanks @jeremy-rifkin.
7676
77-
- Removed the deprecated `has_formatter` trait. Use `is_formattable` instead.
77+
- Removed the following deprecated APIs:
7878
79-
- Removed the deprecated `basic_format_args::parse_context_type`,
80-
`basic_format_args::formatter_type` and similar aliases in context types.
79+
- `has_formatter`: use `is_formattable` instead,
80+
- `basic_format_args::parse_context_type`,
81+
`basic_format_args::formatter_type` and similar aliases in context types,
82+
- wide stream overload of `fmt::printf`,
83+
- wide stream overloads of `fmt::print` that take text styles,
84+
- `is_*char` traits,
85+
- `fmt::localtime`.
8186
82-
- Removed the deprecated wide stream overload of `fmt::printf` and deprecated
83-
wide overloads of `fmt::fprintf` and `fmt::sprintf`.
84-
85-
- Removed the deprecated wide stream overloads of `fmt::print` that take text
86-
styles.
87-
88-
- Removed legacy `is_*char` traits.
87+
- Deprecated wide overloads of `fmt::fprintf` and `fmt::sprintf`.
8988
9089
- Improved diagnostics for the incorrect usage of `fmt::ptr`
9190
(https://github.com/fmtlib/fmt/pull/4453). Thanks @TobiSchluter.

include/fmt/std.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ template <typename Variant, typename Char> class is_variant_formattable {
140140

141141
#if FMT_USE_RTTI
142142

143-
template <typename Char, typename OutputIt>
143+
template <typename OutputIt>
144144
auto write_demangled_name(OutputIt out, const std::type_info& ti) -> OutputIt {
145145
# ifdef FMT_HAS_ABI_CXA_DEMANGLE
146146
int status = 0;
@@ -180,7 +180,7 @@ auto write_demangled_name(OutputIt out, const std::type_info& ti) -> OutputIt {
180180
} else {
181181
demangled_name_view = string_view(ti.name());
182182
}
183-
return detail::write_bytes<Char>(out, demangled_name_view);
183+
return detail::write_bytes<char>(out, demangled_name_view);
184184
# elif FMT_MSC_VERSION
185185
const string_view demangled_name(ti.name());
186186
for (size_t i = 0; i < demangled_name.size(); ++i) {
@@ -202,7 +202,7 @@ auto write_demangled_name(OutputIt out, const std::type_info& ti) -> OutputIt {
202202
}
203203
return out;
204204
# else
205-
return detail::write_bytes<Char>(out, string_view(ti.name()));
205+
return detail::write_bytes<char>(out, string_view(ti.name()));
206206
# endif
207207
}
208208

@@ -541,31 +541,30 @@ template <> struct formatter<std::error_code> {
541541
};
542542

543543
#if FMT_USE_RTTI
544-
template <typename Char>
545-
struct formatter<std::type_info, Char // DEPRECATED! Mixing code unit types.
546-
> {
544+
template <>
545+
struct formatter<std::type_info> {
547546
public:
548-
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
547+
FMT_CONSTEXPR auto parse(parse_context<>& ctx) -> const char* {
549548
return ctx.begin();
550549
}
551550

552551
template <typename Context>
553552
auto format(const std::type_info& ti, Context& ctx) const
554553
-> decltype(ctx.out()) {
555-
return detail::write_demangled_name<Char>(ctx.out(), ti);
554+
return detail::write_demangled_name<char>(ctx.out(), ti);
556555
}
557556
};
558557
#endif // FMT_USE_RTTI
559558

560-
template <typename T, typename Char>
559+
template <typename T>
561560
struct formatter<
562-
T, Char, // DEPRECATED! Mixing code unit types.
561+
T, char,
563562
typename std::enable_if<std::is_base_of<std::exception, T>::value>::type> {
564563
private:
565564
bool with_typename_ = false;
566565

567566
public:
568-
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
567+
FMT_CONSTEXPR auto parse(parse_context<>& ctx) -> const char* {
569568
auto it = ctx.begin();
570569
auto end = ctx.end();
571570
if (it == end || *it == '}') return it;
@@ -582,12 +581,12 @@ struct formatter<
582581
auto out = ctx.out();
583582
#if FMT_USE_RTTI
584583
if (with_typename_) {
585-
out = detail::write_demangled_name<Char>(out, typeid(ex));
584+
out = detail::write_demangled_name<char>(out, typeid(ex));
586585
*out++ = ':';
587586
*out++ = ' ';
588587
}
589588
#endif
590-
return detail::write_bytes<Char>(out, string_view(ex.what()));
589+
return detail::write_bytes<char>(out, string_view(ex.what()));
591590
}
592591
};
593592

0 commit comments

Comments
 (0)