From a32e3c097ece9d1f02ec88b9c4a64aa62522c0a8 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Sat, 16 Feb 2002 00:19:13 +0000 Subject: [PATCH] Tune for size. 2002-02-15 Benjamin Kosnik Tune for size. * src/string-inst.cc (string::_Rep::_S_terminal): Remove redundant explicit instantiation. (string::_Rep::_S_max_size): Same. * include/bits/basic_string.tcc: Add extern explicit instantiations for string, wstring. * include/bits/basic_ios.tcc: Add extern explicit instantiations for ios, wios. * include/bits/streambuf.tcc: Same, for streambuf, wstreambuf. * include/bits/istream.tcc: Same, for istream, wistream. * include/bits/ostream.tcc: Same for ostream, wostream, iostream, wiostream. * include/bits/sstream.tcc: Same, for stringbuf, wstringbuf, istringstream, wistringstream, ostringstream, wostringstream, stringstream, wstringstream. * include/bits/fstream.tcc: Same, for filebuf, wfilebuf, ifstream, wifstream, ofstream, wofstream, fstream, wfstream. * src/misc-inst.cc: Correct comments. Add iomanip instantiations for wide streams. * include/std/std_iomanip.h: Same. * include/bits/locale_facets.tcc: Same. * include/std/std_streambuf.h: Correct _GLIBCPP_FULLY_COMPLIANT_HEADERS guard. * include/std/std_sstream.h: Same. * include/std/std_ostream.h: Same. * include/std/std_istream.h: Same. * include/std/std_fstream.h: Same. * include/std/std_streambuf.h: Add definitions for private copy ctor and assignment operator. * include/std/std_istream.h: Remove declared but undefined copy ctor and assignment operator. This is taken care of in ios_base, so adding it in the derived class as well is superfluous. * include/std/std_ostream.h: Same. * include/bits/basic_ios.h (basic_ios::clear): Don't inline. * include/bits/basic_ios.tcc (basic_ios::clear): Move definition here. From-SVN: r49798 --- libstdc++-v3/ChangeLog | 41 ++++++++++++ libstdc++-v3/include/bits/basic_ios.h | 44 +++++-------- libstdc++-v3/include/bits/basic_ios.tcc | 18 +++++ libstdc++-v3/include/bits/basic_string.tcc | 31 +++++++++ libstdc++-v3/include/bits/fstream.tcc | 12 ++++ libstdc++-v3/include/bits/istream.tcc | 26 ++++++-- libstdc++-v3/include/bits/locale_facets.tcc | 53 +++++++++++++++ libstdc++-v3/include/bits/ostream.tcc | 32 +++++++-- libstdc++-v3/include/bits/sstream.tcc | 12 ++++ libstdc++-v3/include/bits/streambuf.tcc | 15 +++++ libstdc++-v3/include/std/std_fstream.h | 2 +- libstdc++-v3/include/std/std_iomanip.h | 30 ++++++++- libstdc++-v3/include/std/std_istream.h | 13 +--- libstdc++-v3/include/std/std_ostream.h | 12 +--- libstdc++-v3/include/std/std_sstream.h | 2 +- libstdc++-v3/include/std/std_streambuf.h | 8 +-- libstdc++-v3/src/locale-inst.cc | 16 ++--- libstdc++-v3/src/misc-inst.cc | 73 ++++++++------------- libstdc++-v3/src/string-inst.cc | 6 +- 19 files changed, 324 insertions(+), 122 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f755984c059..efc9bade116 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,44 @@ +2002-02-15 Benjamin Kosnik + + Tune for size. + * src/string-inst.cc (string::_Rep::_S_terminal): Remove redundant + explicit instantiation. + (string::_Rep::_S_max_size): Same. + * include/bits/basic_string.tcc: Add extern explicit + instantiations for string, wstring. + * include/bits/basic_ios.tcc: Add extern explicit instantiations + for ios, wios. + * include/bits/streambuf.tcc: Same, for streambuf, wstreambuf. + * include/bits/istream.tcc: Same, for istream, wistream. + * include/bits/ostream.tcc: Same for ostream, wostream, iostream, + wiostream. + * include/bits/sstream.tcc: Same, for stringbuf, wstringbuf, + istringstream, wistringstream, ostringstream, wostringstream, + stringstream, wstringstream. + * include/bits/fstream.tcc: Same, for filebuf, wfilebuf, ifstream, + wifstream, ofstream, wofstream, fstream, wfstream. + * src/misc-inst.cc: Correct comments. + Add iomanip instantiations for wide streams. + * include/std/std_iomanip.h: Same. + * include/bits/locale_facets.tcc: Same. + + * include/std/std_streambuf.h: Correct + _GLIBCPP_FULLY_COMPLIANT_HEADERS guard. + * include/std/std_sstream.h: Same. + * include/std/std_ostream.h: Same. + * include/std/std_istream.h: Same. + * include/std/std_fstream.h: Same. + + * include/std/std_streambuf.h: Add definitions for private copy + ctor and assignment operator. + * include/std/std_istream.h: Remove declared but undefined copy + ctor and assignment operator. This is taken care of in ios_base, + so adding it in the derived class as well is superfluous. + * include/std/std_ostream.h: Same. + + * include/bits/basic_ios.h (basic_ios::clear): Don't inline. + * include/bits/basic_ios.tcc (basic_ios::clear): Move definition here. + 2002-02-14 Benjamin Kosnik * config/linker-map.gnu: Change tag from GCC_3.1 to GLIBCPP_3.1. diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h index f680a508206..f91719582f1 100644 --- a/libstdc++-v3/include/bits/basic_ios.h +++ b/libstdc++-v3/include/bits/basic_ios.h @@ -78,57 +78,49 @@ namespace std const __numget_type* _M_fnumget; public: - inline const __ctype_type* + const __ctype_type* _M_get_fctype_ios(void) { return _M_ios_fctype; } operator void*() const { return this->fail() ? 0 : const_cast(this); } - inline bool + bool operator!() const { return this->fail(); } - inline iostate + iostate rdstate() const { return _M_streambuf_state; } - inline void - clear(iostate __state = goodbit) - { - if (this->rdbuf()) - _M_streambuf_state = __state; - else - _M_streambuf_state = __state | badbit; - if ((this->rdstate() & this->exceptions())) - __throw_ios_failure("basic_ios::clear(iostate) caused exception"); - } + void + clear(iostate __state = goodbit); - inline void + void setstate(iostate __state) { this->clear(this->rdstate() | __state); } - inline bool + bool good() const { return this->rdstate() == 0; } - inline bool + bool eof() const { return (this->rdstate() & eofbit) != 0; } - inline bool + bool fail() const { return (this->rdstate() & (badbit | failbit)) != 0; } - inline bool + bool bad() const { return (this->rdstate() & badbit) != 0; } - inline iostate + iostate exceptions() const { return _M_exception; } - inline void + void exceptions(iostate __except) { _M_exception = __except; @@ -144,11 +136,11 @@ namespace std ~basic_ios() { } // Members: - inline basic_ostream<_CharT, _Traits>* + basic_ostream<_CharT, _Traits>* tie() const { return _M_tie; } - inline basic_ostream<_CharT, _Traits>* + basic_ostream<_CharT, _Traits>* tie(basic_ostream<_CharT, _Traits>* __tiestr) { basic_ostream<_CharT, _Traits>* __old = _M_tie; @@ -156,7 +148,7 @@ namespace std return __old; } - inline basic_streambuf<_CharT, _Traits>* + basic_streambuf<_CharT, _Traits>* rdbuf() const { return _M_streambuf; } @@ -166,11 +158,11 @@ namespace std basic_ios& copyfmt(const basic_ios& __rhs); - inline char_type + char_type fill() const { return _M_fill; } - inline char_type + char_type fill(char_type __ch) { char_type __old = this->fill(); @@ -215,5 +207,3 @@ namespace std #endif #endif /* _CPP_BITS_BASICIOS_H */ - - diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc index dd4329f5cd9..63b797c0b2e 100644 --- a/libstdc++-v3/include/bits/basic_ios.tcc +++ b/libstdc++-v3/include/bits/basic_ios.tcc @@ -32,6 +32,18 @@ namespace std { + template + void + basic_ios<_CharT, _Traits>::clear(iostate __state) + { + if (this->rdbuf()) + _M_streambuf_state = __state; + else + _M_streambuf_state = __state | badbit; + if ((this->rdstate() & this->exceptions())) + __throw_ios_failure("basic_ios::clear(iostate) caused exception"); + } + template basic_streambuf<_CharT, _Traits>* basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb) @@ -165,6 +177,12 @@ namespace std else _M_fnumget = 0; } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class basic_ios; + extern template class basic_ios; } // namespace std #endif diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index 896cd02afa7..dd5038ffe0d 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -938,6 +938,37 @@ namespace std _Traits::copy(__buf, __str.data(), __bytes); __buf[__bytes] = _CharT(); } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class basic_string; + extern template + basic_istream& + operator>>(basic_istream&, string&); + extern template + basic_ostream& + operator<<(basic_ostream&, const string&); + extern template + basic_istream& + getline(basic_istream&, string&, char); + extern template + basic_istream& + getline(basic_istream&, string&); + + extern template class basic_string; + extern template + basic_istream& + operator>>(basic_istream&, wstring&); + extern template + basic_ostream& + operator<<(basic_ostream&, const wstring&); + extern template + basic_istream& + getline(basic_istream&, wstring&, wchar_t); + extern template + basic_istream& + getline(basic_istream&, wstring&); } // namespace std #endif diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 72dadc4000a..e6132d2b31a 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -647,6 +647,18 @@ namespace std // XXX The part in the above comment is not done. _M_last_overflowed = false; } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class basic_filebuf; + extern template class basic_filebuf; + extern template class basic_ifstream; + extern template class basic_ifstream; + extern template class basic_ofstream; + extern template class basic_ofstream; + extern template class basic_fstream; + extern template class basic_fstream; } // namespace std #endif diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc index 4bc8da1c899..566db2e15a1 100644 --- a/libstdc++-v3/include/bits/istream.tcc +++ b/libstdc++-v3/include/bits/istream.tcc @@ -1,4 +1,7 @@ -// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +// istream classes -*- C++ -*- + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -1267,8 +1270,21 @@ namespace std getline(basic_istream<_CharT, _Traits>& __in, basic_string<_CharT,_Traits,_Alloc>& __str) { return getline(__in, __str, __in.widen('\n')); } -} // namespace std -// Local Variables: -// mode:C++ -// End: + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class basic_istream; + extern template istream& ws(istream&); + extern template istream& operator>>(istream&, char&); + extern template istream& operator>>(istream&, char*); + extern template istream& operator>>(istream&, unsigned char&); + extern template istream& operator>>(istream&, signed char&); + extern template istream& operator>>(istream&, unsigned char*); + extern template istream& operator>>(istream&, signed char*); + + extern template class basic_istream; + extern template wistream& ws(wistream&); + extern template wistream& operator>>(wistream&, wchar_t&); + extern template wistream& operator>>(wistream&, wchar_t*); +} // namespace std diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 38ee9251dc4..efea5728c97 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -2038,6 +2038,59 @@ namespace std while (__first != __last); return __s; } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class moneypunct; + extern template class moneypunct; + extern template class moneypunct_byname; + extern template class moneypunct_byname; + extern template class money_get >; + extern template class money_put >; + extern template class moneypunct; + extern template class moneypunct; + extern template class moneypunct_byname; + extern template class moneypunct_byname; + extern template class money_get >; + extern template class money_put >; + extern template class numpunct; + extern template class numpunct_byname; + extern template class num_get >; + extern template class num_put >; + extern template class numpunct; + extern template class numpunct_byname; + extern template class num_get >; + extern template class num_put >; + extern template class __timepunct; + extern template class time_put >; + extern template class time_put_byname >; + extern template class time_get >; + extern template class time_get_byname >; + extern template class __timepunct; + extern template class time_put >; + extern template class time_put_byname >; + extern template class time_get >; + extern template class time_get_byname >; + extern template class messages; + extern template class messages_byname; + extern template class messages; + extern template class messages_byname; + extern template class ctype_byname; + extern template class ctype_byname; + extern template class codecvt_byname; + extern template class codecvt_byname; + extern template class collate; + extern template class collate_byname; + extern template class collate; + extern template class collate_byname; } // namespace std #endif + + + + + + + diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index a08695bc6d1..3182ff33769 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -1,4 +1,7 @@ -// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +// ostream classes -*- C++ -*- + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -679,8 +682,27 @@ namespace std } return __out; } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class basic_ostream; + extern template ostream& endl(ostream&); + extern template ostream& ends(ostream&); + extern template ostream& flush(ostream&); + extern template ostream& operator<<(ostream&, char); + extern template ostream& operator<<(ostream&, unsigned char); + extern template ostream& operator<<(ostream&, signed char); + 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 class basic_ostream; + extern template wostream& endl(wostream&); + extern template wostream& ends(wostream&); + extern template wostream& flush(wostream&); + extern template wostream& operator<<(wostream&, wchar_t); + extern template wostream& operator<<(wostream&, char); + extern template wostream& operator<<(wostream&, const wchar_t*); + extern template wostream& operator<<(wostream&, const char*); } // namespace std - -// Local Variables: -// mode:C++ -// End: diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc index d610532ae75..884c190877f 100644 --- a/libstdc++-v3/include/bits/sstream.tcc +++ b/libstdc++-v3/include/bits/sstream.tcc @@ -206,6 +206,18 @@ namespace std return __ret; } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class basic_stringbuf; + extern template class basic_stringbuf; + extern template class basic_istringstream; + extern template class basic_istringstream; + extern template class basic_ostringstream; + extern template class basic_ostringstream; + extern template class basic_stringstream; + extern template class basic_stringstream; } // namespace std #endif diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc index 81b40716f98..c4cec0fd939 100644 --- a/libstdc++-v3/include/bits/streambuf.tcc +++ b/libstdc++-v3/include/bits/streambuf.tcc @@ -224,6 +224,21 @@ namespace std } return __ret; } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template class basic_streambuf; + extern template + streamsize + __copy_streambufs(basic_ios&, basic_streambuf*, + basic_streambuf*); + + extern template class basic_streambuf; + extern template + streamsize + __copy_streambufs(basic_ios&, basic_streambuf*, + basic_streambuf*); } // namespace std #endif diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h index 92839753bd6..c3273b55fd4 100644 --- a/libstdc++-v3/include/std/std_fstream.h +++ b/libstdc++-v3/include/std/std_fstream.h @@ -505,9 +505,9 @@ namespace std #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export +#endif #ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS # include #endif -#endif #endif diff --git a/libstdc++-v3/include/std/std_iomanip.h b/libstdc++-v3/include/std/std_iomanip.h index 39ecac2c77f..d2e3d3182d4 100644 --- a/libstdc++-v3/include/std/std_iomanip.h +++ b/libstdc++-v3/include/std/std_iomanip.h @@ -47,7 +47,6 @@ namespace std { - struct _Resetiosflags { ios_base::fmtflags _M_mask; }; inline _Resetiosflags @@ -216,6 +215,35 @@ namespace std __os.width(__f._M_n); return __os; } + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. + // NB: This syntax is a GNU extension. + extern template ostream& operator<<(ostream&, _Setfill); + extern template ostream& operator<<(ostream&, _Setiosflags); + extern template ostream& operator<<(ostream&, _Resetiosflags); + extern template ostream& operator<<(ostream&, _Setbase); + extern template ostream& operator<<(ostream&, _Setprecision); + extern template ostream& operator<<(ostream&, _Setw); + extern template wostream& operator<<(wostream&, _Setfill); + extern template wostream& operator<<(wostream&, _Setiosflags); + extern template wostream& operator<<(wostream&, _Resetiosflags); + extern template wostream& operator<<(wostream&, _Setbase); + extern template wostream& operator<<(wostream&, _Setprecision); + extern template wostream& operator<<(wostream&, _Setw); + + extern template istream& operator>>(istream&, _Setfill); + extern template istream& operator>>(istream&, _Setiosflags); + extern template istream& operator>>(istream&, _Resetiosflags); + extern template istream& operator>>(istream&, _Setbase); + extern template istream& operator>>(istream&, _Setprecision); + extern template istream& operator>>(istream&, _Setw); + extern template wistream& operator>>(wistream&, _Setfill); + extern template wistream& operator>>(wistream&, _Setiosflags); + extern template wistream& operator>>(wistream&, _Resetiosflags); + extern template wistream& operator>>(wistream&, _Setbase); + extern template wistream& operator>>(wistream&, _Setprecision); + extern template wistream& operator>>(wistream&, _Setw); } // namespace std #endif diff --git a/libstdc++-v3/include/std/std_istream.h b/libstdc++-v3/include/std/std_istream.h index d2228fa6f26..40f4b67fb9f 100644 --- a/libstdc++-v3/include/std/std_istream.h +++ b/libstdc++-v3/include/std/std_istream.h @@ -204,15 +204,6 @@ namespace std __istream_type& seekg(off_type, ios_base::seekdir); - - private: -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Not defined. (Side effect of DR 50.) - __istream_type& - operator=(const __istream_type&); - - basic_istream(const __istream_type&); -#endif }; template @@ -266,7 +257,7 @@ namespace std // 27.6.1.5 Template class basic_iostream template class basic_iostream - : public basic_istream<_CharT, _Traits>, + : public basic_istream<_CharT, _Traits>, public basic_ostream<_CharT, _Traits> { public: @@ -291,9 +282,9 @@ namespace std #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export +#endif #ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS # include #endif -#endif #endif /* _CPP_ISTREAM */ diff --git a/libstdc++-v3/include/std/std_ostream.h b/libstdc++-v3/include/std/std_ostream.h index 676080c1f20..eff4bb5119f 100644 --- a/libstdc++-v3/include/std/std_ostream.h +++ b/libstdc++-v3/include/std/std_ostream.h @@ -172,15 +172,6 @@ namespace std __ostream_type& seekp(off_type, ios_base::seekdir); - - private: -#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Not defined. (Side effect of DR 50.) - __ostream_type& - operator=(const __ostream_type&); - - basic_ostream(const __ostream_type&); -#endif }; // 27.6.2.3 Class basic_ostream::sentry @@ -279,10 +270,9 @@ namespace std #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export +#endif #ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS # include #endif -#endif #endif /* _CPP_OSTREAM */ - diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h index fc7eb05654f..bbd6dc60b75 100644 --- a/libstdc++-v3/include/std/std_sstream.h +++ b/libstdc++-v3/include/std/std_sstream.h @@ -362,9 +362,9 @@ namespace std #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export +#endif #ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS # include #endif -#endif #endif diff --git a/libstdc++-v3/include/std/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h index 48ffd97e2f7..f57d96fc17d 100644 --- a/libstdc++-v3/include/std/std_streambuf.h +++ b/libstdc++-v3/include/std/std_streambuf.h @@ -518,21 +518,21 @@ namespace std #endif #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS - // Side effect of DR 50. + // Side effect of DR 50. private: - basic_streambuf(const __streambuf_type&); + basic_streambuf(const __streambuf_type&) { }; __streambuf_type& - operator=(const __streambuf_type&); + operator=(const __streambuf_type&) { }; #endif }; } // namespace std #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT # define export +#endif #ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS #include #endif -#endif #endif diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc index 598c3c3869d..324b07e9369 100644 --- a/libstdc++-v3/src/locale-inst.cc +++ b/libstdc++-v3/src/locale-inst.cc @@ -43,10 +43,10 @@ namespace std { - typedef ostreambuf_iterator > obuf_iterator; - typedef istreambuf_iterator > ibuf_iterator; - typedef ostreambuf_iterator > wobuf_iterator; - typedef istreambuf_iterator > wibuf_iterator; + typedef ostreambuf_iterator obuf_iterator; + typedef istreambuf_iterator ibuf_iterator; + typedef ostreambuf_iterator wobuf_iterator; + typedef istreambuf_iterator wibuf_iterator; // moneypunct, money_get, and money_put template class moneypunct; @@ -174,16 +174,16 @@ namespace std #endif // ctype - template class __ctype_abstract_base; + inline template class __ctype_abstract_base; template class ctype_byname; #ifdef _GLIBCPP_USE_WCHAR_T - template class __ctype_abstract_base; + inline template class __ctype_abstract_base; template class ctype_byname; #endif // codecvt - template class __codecvt_abstract_base; - template class __codecvt_abstract_base; + inline template class __codecvt_abstract_base; + inline template class __codecvt_abstract_base; template class codecvt_byname; #ifdef _GLIBCPP_USE_WCHAR_T template class codecvt_byname; diff --git a/libstdc++-v3/src/misc-inst.cc b/libstdc++-v3/src/misc-inst.cc index bb0bd78da93..a276a732ed3 100644 --- a/libstdc++-v3/src/misc-inst.cc +++ b/libstdc++-v3/src/misc-inst.cc @@ -1,6 +1,7 @@ // Explicit instantiation file. -// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -44,7 +45,7 @@ #include #include -// NB: unnecessary if the .h headers include these +// NB: Unnecessary if the .h headers already include these. #ifndef _GLIBCPP_FULLY_COMPLIANT_HEADERS #include #include @@ -55,46 +56,31 @@ namespace std { - - // // streambuf - // template class basic_streambuf; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_streambuf; #endif - - // - // stringstream - // + // stringbuf template class basic_stringbuf; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_stringbuf; #endif - - // - // fstream - // + // filebuf template class basic_filebuf >; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_filebuf >; #endif - - // // basic_ios - // template class basic_ios; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_ios; #endif - - // // iomanip - // template class _Setfill; template _Setfill setfill(char); #ifdef _GLIBCPP_USE_WCHAR_T @@ -102,10 +88,7 @@ namespace std template _Setfill setfill(wchar_t); #endif - - // // istream - // template class basic_istream; template istream& ws(istream&); template istream& operator>>(istream&, char&); @@ -115,10 +98,10 @@ namespace std template istream& operator>>(istream&, unsigned char*); template istream& operator>>(istream&, signed char*); + template istream& operator>>(istream&, _Setfill); template istream& operator>>(istream&, _Setiosflags); template istream& operator>>(istream&, _Resetiosflags); template istream& operator>>(istream&, _Setbase); - template istream& operator>>(istream&, _Setfill); template istream& operator>>(istream&, _Setprecision); template istream& operator>>(istream&, _Setw); @@ -127,13 +110,16 @@ namespace std template wistream& ws(wistream&); template wistream& operator>>(wistream&, wchar_t&); template wistream& operator>>(wistream&, wchar_t*); + template wistream& operator>>(wistream&, _Setfill); + template wistream& operator>>(wistream&, _Setiosflags); + template wistream& operator>>(wistream&, _Resetiosflags); + template wistream& operator>>(wistream&, _Setbase); + template wistream& operator>>(wistream&, _Setprecision); + template wistream& operator>>(wistream&, _Setw); #endif - - // // ostream - // template class basic_ostream; template ostream& endl(ostream&); template ostream& ends(ostream&); @@ -145,10 +131,10 @@ namespace std template ostream& operator<<(ostream&, const unsigned char*); template ostream& operator<<(ostream&, const signed char*); + template ostream& operator<<(ostream&, _Setfill); template ostream& operator<<(ostream&, _Setiosflags); template ostream& operator<<(ostream&, _Resetiosflags); template ostream& operator<<(ostream&, _Setbase); - template ostream& operator<<(ostream&, _Setfill); template ostream& operator<<(ostream&, _Setprecision); template ostream& operator<<(ostream&, _Setw); @@ -161,58 +147,59 @@ namespace std template wostream& operator<<(wostream&, char); template wostream& operator<<(wostream&, const wchar_t*); template wostream& operator<<(wostream&, const char*); + template wostream& operator<<(wostream&, _Setfill); + template wostream& operator<<(wostream&, _Setiosflags); + template wostream& operator<<(wostream&, _Resetiosflags); + template wostream& operator<<(wostream&, _Setbase); + template wostream& operator<<(wostream&, _Setprecision); + template wostream& operator<<(wostream&, _Setw); #endif - // // iostream - // template class basic_iostream; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_iostream; #endif - - // // ifstream - // template class basic_ifstream; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_ifstream; #endif - - // // ofstream - // template class basic_ofstream; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_ofstream; #endif + // fstream + template class basic_fstream; +#ifdef _GLIBCPP_USE_WCHAR_T + template class basic_fstream; +#endif - // // istringstream - // template class basic_istringstream; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_istringstream; #endif - - // // ostringstream - // template class basic_ostringstream; #ifdef _GLIBCPP_USE_WCHAR_T template class basic_ostringstream; #endif + // stringstream + template class basic_stringstream; +#ifdef _GLIBCPP_USE_WCHAR_T + template class basic_stringstream; +#endif - // // string related to iostreams - // template basic_istream& operator>>(basic_istream&, string&); @@ -240,9 +227,7 @@ namespace std getline(basic_istream&, wstring&); #endif - // // algorithm - // typedef _Char_traits_match > char_match; template diff --git a/libstdc++-v3/src/string-inst.cc b/libstdc++-v3/src/string-inst.cc index 4da060fefb2..7ebc0c5abd3 100644 --- a/libstdc++-v3/src/string-inst.cc +++ b/libstdc++-v3/src/string-inst.cc @@ -1,6 +1,7 @@ // Components for manipulating sequences of characters -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -45,9 +46,6 @@ namespace std typedef basic_string S; template class basic_string; - template const C S::_Rep::_S_terminal; - template S::size_type S::_Rep::_S_max_size; - template S operator+(const C*, const S&); template S operator+(C, const S&); template bool operator==(const S::iterator&, const S::iterator&); -- 2.30.2