aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/basic_ios.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/bits/basic_ios.h')
-rw-r--r--libstdc++-v3/include/bits/basic_ios.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h
index f91719582f1..dea2fdb3857 100644
--- a/libstdc++-v3/include/bits/basic_ios.h
+++ b/libstdc++-v3/include/bits/basic_ios.h
@@ -64,7 +64,8 @@ namespace std
// Data members:
protected:
basic_ostream<_CharT, _Traits>* _M_tie;
- char_type _M_fill;
+ mutable char_type _M_fill;
+ mutable bool _M_fill_init;
iostate _M_exception;
basic_streambuf<_CharT, _Traits>* _M_streambuf;
@@ -160,7 +161,14 @@ namespace std
char_type
fill() const
- { return _M_fill; }
+ {
+ if (!_M_fill_init)
+ {
+ _M_fill = this->widen(' ');
+ _M_fill_init = true;
+ }
+ return _M_fill;
+ }
char_type
fill(char_type __ch)