diff --git a/format.h b/format.h index 97e176b0..a1218232 100644 --- a/format.h +++ b/format.h @@ -1493,8 +1493,14 @@ class BasicWriter { // Do not implement! void operator<<(typename internal::CharTraits::UnsupportedStrType); + // Appends floating-point length specifier to the format string. + // The second argument is only used for overload resolution. + void append_float_length(Char *&format_ptr, long double) { + *format_ptr++ = 'L'; + } + template - Char* append_float_length(Char* format_ptr) { return format_ptr; } + void append_float_length(Char *&, T) {} friend class internal::ArgFormatter; friend class internal::PrintfFormatter; @@ -1927,7 +1933,7 @@ void BasicWriter::write_double( *format_ptr++ = '*'; } - format_ptr = append_float_length(format_ptr); + append_float_length(format_ptr, value); *format_ptr++ = type; *format_ptr = '\0'; @@ -1981,16 +1987,6 @@ void BasicWriter::write_double( } } -template <> template <> inline char* BasicWriter::append_float_length( char* format_ptr) { - *format_ptr++ = 'L'; - return format_ptr; -} - -template <> template <> inline wchar_t* BasicWriter::append_float_length( wchar_t* format_ptr) { - *format_ptr++ = 'L'; - return format_ptr; -} - /** \rst This template provides operations for formatting and writing data into