mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-16 15:33:41 +08:00
ostream.tcc (operator<<(basic_ostream<>&, const char*)): Further fix for throwing widen.
2006-10-14 Paolo Carlini <pcarlini@suse.de> * include/bits/ostream.tcc (operator<<(basic_ostream<>&, const char*)): Further fix for throwing widen. From-SVN: r117730
This commit is contained in:
parent
78a438f161
commit
4fb1953207
@ -1,3 +1,8 @@
|
||||
2006-10-14 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/bits/ostream.tcc (operator<<(basic_ostream<>&,
|
||||
const char*)): Further fix for throwing widen.
|
||||
|
||||
2006-10-14 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/bits/ostream.tcc (operator<<(basic_ostream<>&,
|
||||
|
@ -325,17 +325,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
const size_t __clen = char_traits<char>::length(__s);
|
||||
_CharT* __ws = 0;
|
||||
try
|
||||
{ __ws = new _CharT[__clen]; }
|
||||
{
|
||||
__ws = new _CharT[__clen];
|
||||
for (size_t __i = 0; __i < __clen; ++__i)
|
||||
__ws[__i] = __out.widen(__s[__i]);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
delete [] __ws;
|
||||
__out._M_setstate(ios_base::badbit);
|
||||
return __out;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
for (size_t __i = 0; __i < __clen; ++__i)
|
||||
__ws[__i] = __out.widen(__s[__i]);
|
||||
__out._M_insert(__ws, __clen);
|
||||
delete [] __ws;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user