+2004-01-07 Paolo Carlini <pcarlini@suse.de>
+ Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/13007
+ * include/bits/fstream.tcc (imbue): Don't touch the stored
+ locale.
+ * include/std/std_streambuf.h (imbue): According to the
+ standard, base class version does nothing.
+ (pubimbue): Store the locale.
+
2003-12-10 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/6243
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
- imbue(const locale& __loc)
- {
- bool __testbeg = gptr() == eback() && pptr() == pbase();
-
- if (__testbeg && _M_buf_locale != __loc)
- _M_buf_locale = __loc;
-
- // NB this may require the reconversion of previously
- // converted chars. This in turn may cause the reconstruction
- // of the original file. YIKES!!
- // XXX The part in the above comment is not done.
- _M_last_overflowed = false;
- }
+ imbue(const locale&)
+ { _M_last_overflowed = false; }
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
{
locale __tmp(this->getloc());
this->imbue(__loc);
+ _M_buf_locale = __loc;
return __tmp;
}
* are changed by this call. The standard adds, "Between invocations
* of this function a class derived from streambuf can safely cache
* results of calls to locale functions and to members of facets
- * so obtained." This function simply stores the new locale for use
- * by derived classes.
+ * so obtained."
+ *
+ * @note Base class version does nothing.
*/
virtual void
- imbue(const locale& __loc)
- {
- if (_M_buf_locale != __loc)
- _M_buf_locale = __loc;
- }
+ imbue(const locale&)
+ { }
// [27.5.2.4.2] buffer management and positioning
/**