From 838dc1e1890b3dcabbccf0c4f1d2890eaf4a7b13 Mon Sep 17 00:00:00 2001 From: "Daniel.Perry" Date: Tue, 2 Dec 2014 10:20:27 -0500 Subject: [PATCH] move append_float_length specialization to the header --- format.cc | 18 ------------------ format.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/format.cc b/format.cc index 362e702a..fc414fac 100644 --- a/format.cc +++ b/format.cc @@ -1132,24 +1132,6 @@ template int fmt::internal::CharTraits::format_float( wchar_t *buffer, std::size_t size, const wchar_t *format, unsigned width, int precision, long double value); -template <> template <> char* fmt::BasicWriter::append_float_length( char* format_ptr) { return format_ptr; } -template <> template <> wchar_t* fmt::BasicWriter::append_float_length( wchar_t* format_ptr) { return format_ptr; } - -template <> template <> char* fmt::BasicWriter::append_float_length( char* format_ptr) { return format_ptr; } -template <> template <> wchar_t* fmt::BasicWriter::append_float_length( wchar_t* format_ptr) { return format_ptr; } - -template <> template <> char* fmt::BasicWriter::append_float_length( char* format_ptr) -{ - *format_ptr++ = 'L'; - return format_ptr; -} - -template <> template <> wchar_t* fmt::BasicWriter::append_float_length( wchar_t* format_ptr) -{ - *format_ptr++ = 'L'; - return format_ptr; -} - #if _MSC_VER # pragma warning(pop) #endif diff --git a/format.h b/format.h index 1d1a6eb9..4fd237fd 100644 --- a/format.h +++ b/format.h @@ -1494,7 +1494,7 @@ class BasicWriter { void operator<<(typename internal::CharTraits::UnsupportedStrType); template - Char* append_float_length(Char* format_ptr); + Char* append_float_length(Char* format_ptr) { return format_ptr; } friend class internal::ArgFormatter; friend class internal::PrintfFormatter; @@ -1981,6 +1981,16 @@ 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