Skip to content

Commit dd63c21

Browse files
committed
Remove deprecated functions
1 parent e33c76a commit dd63c21

File tree

4 files changed

+20
-47
lines changed

4 files changed

+20
-47
lines changed

doc/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,9 @@ if an argument type doesn't match its format specification.
674674

675675
::: printf(string_view, const T&...)
676676

677-
::: fprintf(std::FILE*, const S&, const T&...)
677+
::: fprintf(std::FILE*, string_view, const T&...)
678678

679-
::: sprintf(const S&, const T&...)
679+
::: sprintf(string_view, const T&...)
680680

681681
<a id="xchar-api"></a>
682682
## Wide Strings

include/fmt/format-inl.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ template <typename Locale> auto locale_ref::get() const -> Locale {
7575

7676
namespace detail {
7777

78-
// DEPRECATED!
79-
FMT_FUNC void assert_fail(const char* file, int line, const char* message) {
80-
fmt::assert_fail(file, line, message);
81-
}
82-
8378
FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code,
8479
string_view message) noexcept {
8580
// Report error code making sure that the output fits into

include/fmt/printf.h

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
FMT_BEGIN_NAMESPACE
1919
FMT_BEGIN_EXPORT
2020

21-
template <typename T> struct printf_formatter {
22-
printf_formatter() = delete;
23-
};
24-
2521
template <typename Char> class basic_printf_context {
2622
private:
2723
basic_appender<Char> out_;
@@ -33,8 +29,6 @@ template <typename Char> class basic_printf_context {
3329

3430
public:
3531
using char_type = Char;
36-
using parse_context_type = parse_context<Char>;
37-
template <typename T> using formatter_type = printf_formatter<T>;
3832
enum { builtin_types = 1 };
3933

4034
/// Constructs a `printf_context` object. References to the arguments are
@@ -74,7 +68,7 @@ inline auto find<false, char>(const char* first, const char* last, char value,
7468

7569
// Checks if a value fits in int - used to avoid warnings about comparing
7670
// signed and unsigned integers.
77-
template <bool IsSigned> struct int_checker {
71+
template <bool SIGNED> struct int_checker {
7872
template <typename T> static auto fits_in_int(T value) -> bool {
7973
return value <= to_unsigned(max_value<int>());
8074
}
@@ -570,15 +564,19 @@ inline auto vsprintf(basic_string_view<Char> fmt,
570564
*
571565
* std::string message = fmt::sprintf("The answer is %d", 42);
572566
*/
573-
template <typename S, typename... T, typename Char = detail::char_t<S>>
574-
inline auto sprintf(const S& fmt, const T&... args) -> std::basic_string<Char> {
575-
return vsprintf(detail::to_string_view(fmt),
576-
fmt::make_format_args<basic_printf_context<Char>>(args...));
567+
template <typename... T>
568+
inline auto sprintf(string_view fmt, const T&... args) -> std::string {
569+
return vsprintf(fmt, make_printf_args(args...));
570+
}
571+
template <typename... T>
572+
FMT_DEPRECATED auto sprintf(basic_string_view<wchar_t> fmt, const T&... args)
573+
-> std::wstring {
574+
return vsprintf(fmt, make_printf_args<wchar_t>(args...));
577575
}
578576

579577
template <typename Char>
580-
inline auto vfprintf(std::FILE* f, basic_string_view<Char> fmt,
581-
typename vprintf_args<Char>::type args) -> int {
578+
auto vfprintf(std::FILE* f, basic_string_view<Char> fmt,
579+
typename vprintf_args<Char>::type args) -> int {
582580
auto buf = basic_memory_buffer<Char>();
583581
detail::vprintf(buf, fmt, args);
584582
size_t size = buf.size();
@@ -595,17 +593,14 @@ inline auto vfprintf(std::FILE* f, basic_string_view<Char> fmt,
595593
*
596594
* fmt::fprintf(stderr, "Don't %s!", "panic");
597595
*/
598-
template <typename S, typename... T, typename Char = detail::char_t<S>>
599-
inline auto fprintf(std::FILE* f, const S& fmt, const T&... args) -> int {
600-
return vfprintf(f, detail::to_string_view(fmt),
601-
make_printf_args<Char>(args...));
596+
template <typename... T>
597+
inline auto fprintf(std::FILE* f, string_view fmt, const T&... args) -> int {
598+
return vfprintf(f, fmt, make_printf_args(args...));
602599
}
603-
604-
template <typename Char>
605-
FMT_DEPRECATED inline auto vprintf(basic_string_view<Char> fmt,
606-
typename vprintf_args<Char>::type args)
607-
-> int {
608-
return vfprintf(stdout, fmt, args);
600+
template <typename... T>
601+
FMT_DEPRECATED auto fprintf(std::FILE* f, basic_string_view<wchar_t> fmt,
602+
const T&... args) -> int {
603+
return vfprintf(f, fmt, make_printf_args<wchar_t>(args...));
609604
}
610605

611606
/**
@@ -620,11 +615,6 @@ template <typename... T>
620615
inline auto printf(string_view fmt, const T&... args) -> int {
621616
return vfprintf(stdout, fmt, make_printf_args(args...));
622617
}
623-
template <typename... T>
624-
FMT_DEPRECATED inline auto printf(basic_string_view<wchar_t> fmt,
625-
const T&... args) -> int {
626-
return vfprintf(stdout, fmt, make_printf_args<wchar_t>(args...));
627-
}
628618

629619
FMT_END_EXPORT
630620
FMT_END_NAMESPACE

include/fmt/xchar.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,18 +330,6 @@ inline auto format(text_style ts, wformat_string<T...> fmt, T&&... args)
330330
return fmt::vformat(ts, fmt, fmt::make_wformat_args(args...));
331331
}
332332

333-
template <typename... T>
334-
FMT_DEPRECATED void print(std::FILE* f, text_style ts, wformat_string<T...> fmt,
335-
const T&... args) {
336-
vprint(f, ts, fmt, fmt::make_wformat_args(args...));
337-
}
338-
339-
template <typename... T>
340-
FMT_DEPRECATED void print(text_style ts, wformat_string<T...> fmt,
341-
const T&... args) {
342-
return print(stdout, ts, fmt, args...);
343-
}
344-
345333
inline void vprint(std::wostream& os, wstring_view fmt, wformat_args args) {
346334
auto buffer = basic_memory_buffer<wchar_t>();
347335
detail::vformat_to(buffer, fmt, args);

0 commit comments

Comments
 (0)