From e979c782d3b4fe428aa3b09b5083b6eb4454fabd Mon Sep 17 00:00:00 2001 From: Ivan Shynkarenka Date: Tue, 26 Mar 2019 00:27:10 +0300 Subject: [PATCH] Extend basic_writer with write() method for doubles with optional format_specs argument --- include/fmt/format.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 0d08ec2f..e13f498d 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2703,7 +2703,9 @@ template class basic_writer { write_int(value, s); } - void write(double value) { write_double(value, format_specs()); } + void write(double value, const format_specs& spec = format_specs()) { + write_double(value, spec); + } /** \rst @@ -2711,7 +2713,9 @@ template class basic_writer { (``'g'``) and writes it to the buffer. \endrst */ - void write(long double value) { write_double(value, format_specs()); } + void write(long double value, const format_specs& spec = format_specs()) { + write_double(value, spec); + } /** Writes a character to the buffer. */ void write(char value) {