@@ -1645,8 +1645,8 @@ struct FormatSpec : AlignSpec {
16451645 char type_;
16461646
16471647 FormatSpec (
1648- unsigned width = 0 , char type = 0 , wchar_t fill = ' ' )
1649- : AlignSpec(width, fill), flags_(0 ), precision_(- 1 ), type_(type) {}
1648+ unsigned width = 0 , char type = 0 , wchar_t fill = ' ' , int prec = - 1 )
1649+ : AlignSpec(width, fill), flags_(0 ), precision_(prec ), type_(type) {}
16501650
16511651 bool flag (unsigned f) const { return (flags_ & f) != 0 ; }
16521652 int precision () const { return precision_; }
@@ -2344,9 +2344,20 @@ class SystemError : public internal::RuntimeError {
23442344template <typename Char>
23452345class BasicWriter {
23462346 private:
2347- // Output buffer.
2347+ // / Output buffer.
23482348 Buffer<Char> &buffer_;
23492349
2350+ FormatSpec fmtspec_double_
2351+ {
2352+ 0 , 0 , ' ' ,
2353+ std::numeric_limits<double >::max_digits10
2354+ };
2355+ FormatSpec fmtspec_long_double_
2356+ {
2357+ 0 , 0 , ' ' ,
2358+ std::numeric_limits<long double >::max_digits10
2359+ };
2360+
23502361 FMT_DISALLOW_COPY_AND_ASSIGN (BasicWriter);
23512362
23522363 typedef typename internal::CharTraits<Char>::CharPtr CharPtr;
@@ -2548,7 +2559,7 @@ class BasicWriter {
25482559 }
25492560
25502561 BasicWriter &operator <<(double value) {
2551- write_double (value, FormatSpec () );
2562+ write_double (value, fmtspec_double_ );
25522563 return *this ;
25532564 }
25542565
@@ -2559,7 +2570,7 @@ class BasicWriter {
25592570 \endrst
25602571 */
25612572 BasicWriter &operator <<(long double value) {
2562- write_double (value, FormatSpec () );
2573+ write_double (value, fmtspec_long_double_ );
25632574 return *this ;
25642575 }
25652576
0 commit comments