summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/ostream.tcc
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-10 10:38:50 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-10 10:38:50 +0000
commitdf18f012baa930eedaad05da15b66a1129f9915a (patch)
treec2f36c400bda33a004dbc1bd37ecfae118cdf756 /libstdc++-v3/include/bits/ostream.tcc
parentd8d6e6ac2cd9ea99aef3cb10a1990be829aea2f1 (diff)
downloadppe42-gcc-df18f012baa930eedaad05da15b66a1129f9915a.tar.gz
ppe42-gcc-df18f012baa930eedaad05da15b66a1129f9915a.zip
2007-04-10 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/28277 (partial: vstring bits) * include/bits/ostream_insert.h: New. * include/Makefile.am: Add. * include/ext/vstring.h (operator<<(basic_ostream<>&, const __versa_string<>&): Forward to __ostream_insert. * include/bits/basic_string.h (operator<<(basic_ostream<>&, const string<>&)): Likewise. * include/std/ostream (operator<<(basic_ostream<>&, _CharT), operator<<(basic_ostream<char,>&, char), operator<<(basic_ostream<>&, const _CharT*), operator<<(basic_ostream<char,>&, const char*)): Likewise. * include/ext/vstring.tcc (operator<<(basic_ostream<>&, const __versa_string<>&)): Remove. (class basic_ostream): Remove friend declarations. (basic_ostream<>::_M_write(char_type, streamsize), _M_insert(const char_type*, streamsize)): Remove. * include/bits/ostream.tcc (_M_insert(const char_type*, streamsize)): Remove definition. (operator<<(basic_ostream<>&, const char*)): Use __ostream_insert. * config/abi/pre/gnu.ver: Adjust. * src/ostream-inst.cc: Add __ostream_insert instantiations. * include/bits/locale_facets.h (__pad<>::_S_pad): Remove __num parameter. * include/bits/locale_facets.tcc (__pad<>::_S_pad): Adjust. (num_put<>::_M_pad(_CharT, streamsize, ios_base&, _CharT*, const _CharT*, int&)): Likewise. * include/Makefile.in: Rebuild. * testsuite/ext/vstring/inserters_extractors/char/28277.cc: New. * testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc: New. * include/ext/vstring_util.h: Do not include the whole <locale>. * include/ext/vstring.tcc (operator>>(basic_istream<>&, __versa_string<>&, getline(basic_istream<>&, __versa_string<>&, _CharT)): Tweak to refer to ios_base as a base of istream; do not refer to non-standard types of istream. * include/bits/istream.tcc (operator>>(basic_istream<>&, _CharT*), ws(basic_istream<>&)): Do not refer to non-standard types of istream. * include/std/bitset (operator>>(std::basic_istream<>&, bitset<>&)): Avoid using basic_streambuf<>*. * include/bits/istream.tcc (operator>>(basic_istream<>&, basic_string<>&), getline(basic_istream<>&, basic_string<>&, _CharT)): Move... * include/bits/basic_string.tcc: ... here; tweak to refer to ios_base as a base of istream; do not refer to non-standard types of istream. * include/std/string: Tweak includes. * include/ext/type_traits.h (__is_null_pointer): Add. * include/ext/rc_string_base.h: Use it. * include/ext/sso_string_base.h: Likewise. * include/bits/basic_string.tcc (__is_null_pointer): Remove, use the above. * include/ext/vstring_util.h (__vstring_utility<>::_S_is_null_pointer): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123692 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/ostream.tcc')
-rw-r--r--libstdc++-v3/include/bits/ostream.tcc37
1 files changed, 4 insertions, 33 deletions
diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc
index 4d549655675..7788015158d 100644
--- a/libstdc++-v3/include/bits/ostream.tcc
+++ b/libstdc++-v3/include/bits/ostream.tcc
@@ -281,38 +281,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::
- _M_insert(const char_type* __s, streamsize __n)
- {
- sentry __cerb(*this);
- if (__cerb)
- {
- try
- {
- const streamsize __w = this->width();
- if (__w > __n)
- {
- const bool __left = ((this->flags() & ios_base::adjustfield)
- == ios_base::left);
- if (!__left)
- _M_write(this->fill(), __w - __n);
- if (this->good())
- _M_write(__s, __n);
- if (__left && this->good())
- _M_write(this->fill(), __w - __n);
- }
- else
- _M_write(__s, __n);
- this->width(0);
- }
- catch(...)
- { this->_M_setstate(ios_base::badbit); }
- }
- return *this;
- }
-
- template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
{
if (!__s)
@@ -338,7 +306,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
try
{
- __out._M_insert(__ws, __clen);
+ __ostream_insert(__out, __ws, __clen);
delete [] __ws;
}
catch(...)
@@ -364,6 +332,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
extern template ostream& operator<<(ostream&, const char*);
extern template ostream& operator<<(ostream&, const unsigned char*);
extern template ostream& operator<<(ostream&, const signed char*);
+ extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
extern template ostream& ostream::_M_insert(long);
extern template ostream& ostream::_M_insert(unsigned long);
@@ -385,6 +354,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
extern template wostream& operator<<(wostream&, char);
extern template wostream& operator<<(wostream&, const wchar_t*);
extern template wostream& operator<<(wostream&, const char*);
+ extern template wostream& __ostream_insert(wostream&, const wchar_t*,
+ streamsize);
extern template wostream& wostream::_M_insert(long);
extern template wostream& wostream::_M_insert(unsigned long);
OpenPOWER on IntegriCloud