mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 20:18:49 +00:00
Extend basic_writer with write() method for doubles with optional format_specs argument
This commit is contained in:
parent
9e1531c1e1
commit
e979c782d3
@ -2703,7 +2703,9 @@ template <typename Range> 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 <typename Range> 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user