[v3] tune for size
Benjamin Kosnik
bkoz@redhat.com
Fri Feb 15 17:24:00 GMT 2002
Use extern explicit instantiations for required types. Clean up
instantiations.
hello.cc
gcc-2.96 gcc-3.0 gcc-3.1 icc-5.01
shared 14k 25k 15k 461k
shared strip 3.7k 12k 4.4k 333k
static 1.7M 5.3M 5.0M 2.1M
-benjamin
tested x86/linux
2002-02-15 Benjamin Kosnik <bkoz@redhat.com>
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.
Index: include/bits/basic_ios.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_ios.h,v
retrieving revision 1.9
diff -c -p -r1.9 basic_ios.h
*** basic_ios.h 2002/01/25 06:36:31 1.9
--- basic_ios.h 2002/02/15 23:55:25
*************** namespace std
*** 78,134 ****
const __numget_type* _M_fnumget;
public:
! inline const __ctype_type*
_M_get_fctype_ios(void)
{ return _M_ios_fctype; }
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
! inline bool
operator!() const
{ return this->fail(); }
! inline 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");
! }
! inline void
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
! inline bool
good() const
{ return this->rdstate() == 0; }
! inline bool
eof() const
{ return (this->rdstate() & eofbit) != 0; }
! inline bool
fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; }
! inline bool
bad() const
{ return (this->rdstate() & badbit) != 0; }
! inline iostate
exceptions() const
{ return _M_exception; }
! inline void
exceptions(iostate __except)
{
_M_exception = __except;
--- 78,126 ----
const __numget_type* _M_fnumget;
public:
! const __ctype_type*
_M_get_fctype_ios(void)
{ return _M_ios_fctype; }
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
! bool
operator!() const
{ return this->fail(); }
! iostate
rdstate() const
{ return _M_streambuf_state; }
! void
! clear(iostate __state = goodbit);
! void
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
! bool
good() const
{ return this->rdstate() == 0; }
! bool
eof() const
{ return (this->rdstate() & eofbit) != 0; }
! bool
fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; }
! bool
bad() const
{ return (this->rdstate() & badbit) != 0; }
! iostate
exceptions() const
{ return _M_exception; }
! void
exceptions(iostate __except)
{
_M_exception = __except;
*************** namespace std
*** 144,154 ****
~basic_ios() { }
// Members:
! inline basic_ostream<_CharT, _Traits>*
tie() const
{ return _M_tie; }
! inline basic_ostream<_CharT, _Traits>*
tie(basic_ostream<_CharT, _Traits>* __tiestr)
{
basic_ostream<_CharT, _Traits>* __old = _M_tie;
--- 136,146 ----
~basic_ios() { }
// Members:
! basic_ostream<_CharT, _Traits>*
tie() const
{ return _M_tie; }
! basic_ostream<_CharT, _Traits>*
tie(basic_ostream<_CharT, _Traits>* __tiestr)
{
basic_ostream<_CharT, _Traits>* __old = _M_tie;
*************** namespace std
*** 156,162 ****
return __old;
}
! inline basic_streambuf<_CharT, _Traits>*
rdbuf() const
{ return _M_streambuf; }
--- 148,154 ----
return __old;
}
! basic_streambuf<_CharT, _Traits>*
rdbuf() const
{ return _M_streambuf; }
*************** namespace std
*** 166,176 ****
basic_ios&
copyfmt(const basic_ios& __rhs);
! inline char_type
fill() const
{ return _M_fill; }
! inline char_type
fill(char_type __ch)
{
char_type __old = this->fill();
--- 158,168 ----
basic_ios&
copyfmt(const basic_ios& __rhs);
! char_type
fill() const
{ return _M_fill; }
! char_type
fill(char_type __ch)
{
char_type __old = this->fill();
*************** namespace std
*** 215,219 ****
#endif
#endif /* _CPP_BITS_BASICIOS_H */
-
-
--- 207,209 ----
Index: include/bits/basic_ios.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_ios.tcc,v
retrieving revision 1.9
diff -c -p -r1.9 basic_ios.tcc
*** basic_ios.tcc 2002/02/07 20:28:55 1.9
--- basic_ios.tcc 2002/02/15 23:55:26
***************
*** 33,38 ****
--- 33,50 ----
namespace std
{
template<typename _CharT, typename _Traits>
+ 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<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>*
basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
{
*************** namespace std
*** 165,170 ****
--- 177,188 ----
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<char>;
+ extern template class basic_ios<wchar_t>;
} // namespace std
#endif
Index: include/bits/basic_string.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_string.tcc,v
retrieving revision 1.18
diff -c -p -r1.18 basic_string.tcc
*** basic_string.tcc 2002/02/12 04:35:56 1.18
--- basic_string.tcc 2002/02/15 23:55:28
*************** namespace std
*** 938,943 ****
--- 938,974 ----
_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<char>;
+ extern template
+ basic_istream<char>&
+ operator>>(basic_istream<char>&, string&);
+ extern template
+ basic_ostream<char>&
+ operator<<(basic_ostream<char>&, const string&);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&, char);
+ extern template
+ basic_istream<char>&
+ getline(basic_istream<char>&, string&);
+
+ extern template class basic_string<wchar_t>;
+ extern template
+ basic_istream<wchar_t>&
+ operator>>(basic_istream<wchar_t>&, wstring&);
+ extern template
+ basic_ostream<wchar_t>&
+ operator<<(basic_ostream<wchar_t>&, const wstring&);
+ extern template
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>&, wstring&, wchar_t);
+ extern template
+ basic_istream<wchar_t>&
+ getline(basic_istream<wchar_t>&, wstring&);
} // namespace std
#endif
Index: include/bits/fstream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/fstream.tcc,v
retrieving revision 1.23
diff -c -p -r1.23 fstream.tcc
*** fstream.tcc 2002/02/08 12:59:49 1.23
--- fstream.tcc 2002/02/15 23:55:30
*************** namespace std
*** 647,652 ****
--- 647,664 ----
// 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<char>;
+ extern template class basic_filebuf<wchar_t>;
+ extern template class basic_ifstream<char>;
+ extern template class basic_ifstream<wchar_t>;
+ extern template class basic_ofstream<char>;
+ extern template class basic_ofstream<wchar_t>;
+ extern template class basic_fstream<char>;
+ extern template class basic_fstream<wchar_t>;
} // namespace std
#endif
Index: include/bits/istream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/istream.tcc,v
retrieving revision 1.22
diff -c -p -r1.22 istream.tcc
*** istream.tcc 2002/01/04 21:27:31 1.22
--- istream.tcc 2002/02/15 23:55:33
***************
*** 1,4 ****
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 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
--- 1,7 ----
! // 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
*************** namespace std
*** 1267,1274 ****
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:
--- 1270,1290 ----
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT,_Traits,_Alloc>& __str)
{ return getline(__in, __str, __in.widen('\n')); }
! // 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<char>;
! 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<wchar_t>;
! extern template wistream& ws(wistream&);
! extern template wistream& operator>>(wistream&, wchar_t&);
! extern template wistream& operator>>(wistream&, wchar_t*);
! } // namespace std
Index: include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.60
diff -c -p -r1.60 locale_facets.tcc
*** locale_facets.tcc 2002/02/11 18:56:24 1.60
--- locale_facets.tcc 2002/02/15 23:55:38
*************** namespace std
*** 2038,2043 ****
--- 2038,2096 ----
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<char, false>;
+ extern template class moneypunct<char, true>;
+ extern template class moneypunct_byname<char, false>;
+ extern template class moneypunct_byname<char, true>;
+ extern template class money_get<char, istreambuf_iterator<char> >;
+ extern template class money_put<char, ostreambuf_iterator<char> >;
+ extern template class moneypunct<wchar_t, false>;
+ extern template class moneypunct<wchar_t, true>;
+ extern template class moneypunct_byname<wchar_t, false>;
+ extern template class moneypunct_byname<wchar_t, true>;
+ extern template class money_get<wchar_t, istreambuf_iterator<wchar_t> >;
+ extern template class money_put<wchar_t, ostreambuf_iterator<wchar_t> >;
+ extern template class numpunct<char>;
+ extern template class numpunct_byname<char>;
+ extern template class num_get<char, istreambuf_iterator<char> >;
+ extern template class num_put<char, ostreambuf_iterator<char> >;
+ extern template class numpunct<wchar_t>;
+ extern template class numpunct_byname<wchar_t>;
+ extern template class num_get<wchar_t, istreambuf_iterator<wchar_t> >;
+ extern template class num_put<wchar_t, ostreambuf_iterator<wchar_t> >;
+ extern template class __timepunct<char>;
+ extern template class time_put<char, ostreambuf_iterator<char> >;
+ extern template class time_put_byname<char, ostreambuf_iterator<char> >;
+ extern template class time_get<char, istreambuf_iterator<char> >;
+ extern template class time_get_byname<char, istreambuf_iterator<char> >;
+ extern template class __timepunct<wchar_t>;
+ extern template class time_put<wchar_t, ostreambuf_iterator<wchar_t> >;
+ extern template class time_put_byname<wchar_t, ostreambuf_iterator<wchar_t> >;
+ extern template class time_get<wchar_t, istreambuf_iterator<wchar_t> >;
+ extern template class time_get_byname<wchar_t, istreambuf_iterator<wchar_t> >;
+ extern template class messages<char>;
+ extern template class messages_byname<char>;
+ extern template class messages<wchar_t>;
+ extern template class messages_byname<wchar_t>;
+ extern template class ctype_byname<char>;
+ extern template class ctype_byname<wchar_t>;
+ extern template class codecvt_byname<char, char, mbstate_t>;
+ extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+ extern template class collate<char>;
+ extern template class collate_byname<char>;
+ extern template class collate<wchar_t>;
+ extern template class collate_byname<wchar_t>;
} // namespace std
#endif
+
+
+
+
+
+
+
Index: include/bits/ostream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/ostream.tcc,v
retrieving revision 1.20
diff -c -p -r1.20 ostream.tcc
*** ostream.tcc 2002/01/24 20:46:33 1.20
--- ostream.tcc 2002/02/15 23:55:39
***************
*** 1,4 ****
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 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
--- 1,7 ----
! // 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
*************** namespace std
*** 679,686 ****
}
return __out;
}
} // namespace std
-
- // Local Variables:
- // mode:C++
- // End:
--- 682,708 ----
}
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<char>;
+ 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<wchar_t>;
+ 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
Index: include/bits/sstream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/sstream.tcc,v
retrieving revision 1.6
diff -c -p -r1.6 sstream.tcc
*** sstream.tcc 2002/02/01 03:20:39 1.6
--- sstream.tcc 2002/02/15 23:55:40
*************** namespace std
*** 206,211 ****
--- 206,223 ----
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<char>;
+ extern template class basic_stringbuf<wchar_t>;
+ extern template class basic_istringstream<char>;
+ extern template class basic_istringstream<wchar_t>;
+ extern template class basic_ostringstream<char>;
+ extern template class basic_ostringstream<wchar_t>;
+ extern template class basic_stringstream<char>;
+ extern template class basic_stringstream<wchar_t>;
} // namespace std
#endif
Index: include/bits/streambuf.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/streambuf.tcc,v
retrieving revision 1.10
diff -c -p -r1.10 streambuf.tcc
*** streambuf.tcc 2002/02/01 03:20:39 1.10
--- streambuf.tcc 2002/02/15 23:55:41
*************** namespace std
*** 224,229 ****
--- 224,244 ----
}
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<char>;
+ extern template
+ streamsize
+ __copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
+ basic_streambuf<char>*);
+
+ extern template class basic_streambuf<wchar_t>;
+ extern template
+ streamsize
+ __copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
+ basic_streambuf<wchar_t>*);
} // namespace std
#endif
Index: include/std/std_fstream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_fstream.h,v
retrieving revision 1.5
diff -c -p -r1.5 std_fstream.h
*** std_fstream.h 2002/02/08 01:34:40 1.5
--- std_fstream.h 2002/02/15 23:55:42
*************** namespace std
*** 505,513 ****
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/fstream.tcc>
- #endif
#endif
#endif
--- 505,513 ----
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
+ #endif
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/fstream.tcc>
#endif
#endif
Index: include/std/std_iomanip.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_iomanip.h,v
retrieving revision 1.2
diff -c -p -r1.2 std_iomanip.h
*** std_iomanip.h 2002/01/28 22:13:10 1.2
--- std_iomanip.h 2002/02/15 23:55:43
***************
*** 47,53 ****
namespace std
{
-
struct _Resetiosflags { ios_base::fmtflags _M_mask; };
inline _Resetiosflags
--- 47,52 ----
*************** namespace std
*** 216,221 ****
--- 215,249 ----
__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<char>);
+ 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<wchar_t>);
+ 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<char>);
+ 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<wchar_t>);
+ 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
Index: include/std/std_istream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_istream.h,v
retrieving revision 1.2
diff -c -p -r1.2 std_istream.h
*** std_istream.h 2002/01/28 22:13:10 1.2
--- std_istream.h 2002/02/15 23:55:43
*************** namespace std
*** 204,218 ****
__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<typename _CharT, typename _Traits>
--- 204,209 ----
*************** namespace std
*** 266,272 ****
// 27.6.1.5 Template class basic_iostream
template<typename _CharT, typename _Traits>
class basic_iostream
! : public basic_istream<_CharT, _Traits>,
public basic_ostream<_CharT, _Traits>
{
public:
--- 257,263 ----
// 27.6.1.5 Template class basic_iostream
template<typename _CharT, typename _Traits>
class basic_iostream
! : public basic_istream<_CharT, _Traits>,
public basic_ostream<_CharT, _Traits>
{
public:
*************** namespace std
*** 291,299 ****
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/istream.tcc>
- #endif
#endif
#endif /* _CPP_ISTREAM */
--- 282,290 ----
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
+ #endif
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/istream.tcc>
#endif
#endif /* _CPP_ISTREAM */
Index: include/std/std_ostream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_ostream.h,v
retrieving revision 1.3
diff -c -p -r1.3 std_ostream.h
*** std_ostream.h 2002/01/28 22:13:11 1.3
--- std_ostream.h 2002/02/15 23:55:44
*************** namespace std
*** 172,186 ****
__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
--- 172,177 ----
*************** namespace std
*** 279,288 ****
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/ostream.tcc>
#endif
- #endif
#endif /* _CPP_OSTREAM */
-
--- 270,278 ----
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
+ #endif
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/ostream.tcc>
#endif
#endif /* _CPP_OSTREAM */
Index: include/std/std_sstream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_sstream.h,v
retrieving revision 1.3
diff -c -p -r1.3 std_sstream.h
*** std_sstream.h 2002/02/01 03:20:39 1.3
--- std_sstream.h 2002/02/15 23:55:45
*************** namespace std
*** 362,370 ****
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/sstream.tcc>
- #endif
#endif
#endif
--- 362,370 ----
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
+ #endif
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
# include <bits/sstream.tcc>
#endif
#endif
Index: include/std/std_streambuf.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_streambuf.h,v
retrieving revision 1.3
diff -c -p -r1.3 std_streambuf.h
*** std_streambuf.h 2002/02/01 03:20:39 1.3
--- std_streambuf.h 2002/02/15 23:55:46
*************** namespace std
*** 518,538 ****
#endif
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
! // Side effect of DR 50.
private:
! basic_streambuf(const __streambuf_type&);
__streambuf_type&
! operator=(const __streambuf_type&);
#endif
};
} // namespace std
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
#include <bits/streambuf.tcc>
- #endif
#endif
#endif
--- 518,538 ----
#endif
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
! // Side effect of DR 50.
private:
! basic_streambuf(const __streambuf_type&) { };
__streambuf_type&
! operator=(const __streambuf_type&) { };
#endif
};
} // namespace std
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
+ #endif
#ifdef _GLIBCPP_FULLY_COMPLIANT_HEADERS
#include <bits/streambuf.tcc>
#endif
#endif
Index: src/locale-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale-inst.cc,v
retrieving revision 1.28
diff -c -p -r1.28 locale-inst.cc
*** locale-inst.cc 2002/02/13 18:29:11 1.28
--- locale-inst.cc 2002/02/15 23:55:48
***************
*** 43,52 ****
namespace std
{
! typedef ostreambuf_iterator<char, char_traits<char> > obuf_iterator;
! typedef istreambuf_iterator<char, char_traits<char> > ibuf_iterator;
! typedef ostreambuf_iterator<wchar_t, char_traits<wchar_t> > wobuf_iterator;
! typedef istreambuf_iterator<wchar_t, char_traits<wchar_t> > wibuf_iterator;
// moneypunct, money_get, and money_put
template class moneypunct<char, false>;
--- 43,52 ----
namespace std
{
! typedef ostreambuf_iterator<char> obuf_iterator;
! typedef istreambuf_iterator<char> ibuf_iterator;
! typedef ostreambuf_iterator<wchar_t> wobuf_iterator;
! typedef istreambuf_iterator<wchar_t> wibuf_iterator;
// moneypunct, money_get, and money_put
template class moneypunct<char, false>;
*************** namespace std
*** 174,189 ****
#endif
// ctype
! template class __ctype_abstract_base<char>;
template class ctype_byname<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
! template class __ctype_abstract_base<wchar_t>;
template class ctype_byname<wchar_t>;
#endif
// codecvt
! template class __codecvt_abstract_base<char, char, mbstate_t>;
! template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
template class codecvt_byname<char, char, mbstate_t>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class codecvt_byname<wchar_t, char, mbstate_t>;
--- 174,189 ----
#endif
// ctype
! inline template class __ctype_abstract_base<char>;
template class ctype_byname<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
! inline template class __ctype_abstract_base<wchar_t>;
template class ctype_byname<wchar_t>;
#endif
// codecvt
! inline template class __codecvt_abstract_base<char, char, mbstate_t>;
! inline template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
template class codecvt_byname<char, char, mbstate_t>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class codecvt_byname<wchar_t, char, mbstate_t>;
Index: src/misc-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/misc-inst.cc,v
retrieving revision 1.14
diff -c -p -r1.14 misc-inst.cc
*** misc-inst.cc 2002/01/04 21:27:35 1.14
--- misc-inst.cc 2002/02/15 23:55:48
***************
*** 1,6 ****
// Explicit instantiation file.
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 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
--- 1,7 ----
// Explicit instantiation file.
! // 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,50 ****
#include <ostream>
#include <iomanip>
! // NB: unnecessary if the .h headers include these
#ifndef _GLIBCPP_FULLY_COMPLIANT_HEADERS
#include <bits/sstream.tcc>
#include <bits/fstream.tcc>
--- 45,51 ----
#include <ostream>
#include <iomanip>
! // NB: Unnecessary if the .h headers already include these.
#ifndef _GLIBCPP_FULLY_COMPLIANT_HEADERS
#include <bits/sstream.tcc>
#include <bits/fstream.tcc>
***************
*** 55,100 ****
namespace std
{
-
- //
// streambuf
- //
template class basic_streambuf<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_streambuf<wchar_t>;
#endif
-
! //
! // stringstream
! //
template class basic_stringbuf<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_stringbuf<wchar_t>;
#endif
!
! //
! // fstream
! //
template class basic_filebuf<char, char_traits<char> >;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_filebuf<wchar_t, char_traits<wchar_t> >;
#endif
-
- //
// basic_ios
- //
template class basic_ios<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ios<wchar_t>;
#endif
-
- //
// iomanip
- //
template class _Setfill<char>;
template _Setfill<char> setfill(char);
#ifdef _GLIBCPP_USE_WCHAR_T
--- 56,86 ----
namespace std
{
// streambuf
template class basic_streambuf<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_streambuf<wchar_t>;
#endif
! // stringbuf
template class basic_stringbuf<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_stringbuf<wchar_t>;
#endif
! // filebuf
template class basic_filebuf<char, char_traits<char> >;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_filebuf<wchar_t, char_traits<wchar_t> >;
#endif
// basic_ios
template class basic_ios<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ios<wchar_t>;
#endif
// iomanip
template class _Setfill<char>;
template _Setfill<char> setfill(char);
#ifdef _GLIBCPP_USE_WCHAR_T
*************** namespace std
*** 102,111 ****
template _Setfill<wchar_t> setfill(wchar_t);
#endif
-
- //
// istream
- //
template class basic_istream<char>;
template istream& ws(istream&);
template istream& operator>>(istream&, char&);
--- 88,94 ----
*************** namespace std
*** 115,124 ****
template istream& operator>>(istream&, unsigned char*);
template istream& operator>>(istream&, signed char*);
template istream& operator>>(istream&, _Setiosflags);
template istream& operator>>(istream&, _Resetiosflags);
template istream& operator>>(istream&, _Setbase);
- template istream& operator>>(istream&, _Setfill<char>);
template istream& operator>>(istream&, _Setprecision);
template istream& operator>>(istream&, _Setw);
--- 98,107 ----
template istream& operator>>(istream&, unsigned char*);
template istream& operator>>(istream&, signed char*);
+ template istream& operator>>(istream&, _Setfill<char>);
template istream& operator>>(istream&, _Setiosflags);
template istream& operator>>(istream&, _Resetiosflags);
template istream& operator>>(istream&, _Setbase);
template istream& operator>>(istream&, _Setprecision);
template istream& operator>>(istream&, _Setw);
*************** namespace std
*** 127,139 ****
template wistream& ws(wistream&);
template wistream& operator>>(wistream&, wchar_t&);
template wistream& operator>>(wistream&, wchar_t*);
template wistream& operator>>(wistream&, _Setfill<wchar_t>);
#endif
-
- //
// ostream
- //
template class basic_ostream<char>;
template ostream& endl(ostream&);
template ostream& ends(ostream&);
--- 110,125 ----
template wistream& ws(wistream&);
template wistream& operator>>(wistream&, wchar_t&);
template wistream& operator>>(wistream&, wchar_t*);
+
template wistream& operator>>(wistream&, _Setfill<wchar_t>);
+ 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<char>;
template ostream& endl(ostream&);
template ostream& ends(ostream&);
*************** namespace std
*** 145,154 ****
template ostream& operator<<(ostream&, const unsigned char*);
template ostream& operator<<(ostream&, const signed char*);
template ostream& operator<<(ostream&, _Setiosflags);
template ostream& operator<<(ostream&, _Resetiosflags);
template ostream& operator<<(ostream&, _Setbase);
- template ostream& operator<<(ostream&, _Setfill<char>);
template ostream& operator<<(ostream&, _Setprecision);
template ostream& operator<<(ostream&, _Setw);
--- 131,140 ----
template ostream& operator<<(ostream&, const unsigned char*);
template ostream& operator<<(ostream&, const signed char*);
+ template ostream& operator<<(ostream&, _Setfill<char>);
template ostream& operator<<(ostream&, _Setiosflags);
template ostream& operator<<(ostream&, _Resetiosflags);
template ostream& operator<<(ostream&, _Setbase);
template ostream& operator<<(ostream&, _Setprecision);
template ostream& operator<<(ostream&, _Setw);
*************** namespace std
*** 161,218 ****
template wostream& operator<<(wostream&, char);
template wostream& operator<<(wostream&, const wchar_t*);
template wostream& operator<<(wostream&, const char*);
template wostream& operator<<(wostream&, _Setfill<wchar_t>);
#endif
- //
// iostream
- //
template class basic_iostream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_iostream<wchar_t>;
#endif
-
- //
// ifstream
- //
template class basic_ifstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ifstream<wchar_t>;
#endif
-
- //
// ofstream
- //
template class basic_ofstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ofstream<wchar_t>;
#endif
- //
// istringstream
- //
template class basic_istringstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_istringstream<wchar_t>;
#endif
-
- //
// ostringstream
- //
template class basic_ostringstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ostringstream<wchar_t>;
#endif
- //
// string related to iostreams
- //
template
basic_istream<char>&
operator>>(basic_istream<char>&, string&);
--- 147,205 ----
template wostream& operator<<(wostream&, char);
template wostream& operator<<(wostream&, const wchar_t*);
template wostream& operator<<(wostream&, const char*);
+
template wostream& operator<<(wostream&, _Setfill<wchar_t>);
+ 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<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_iostream<wchar_t>;
#endif
// ifstream
template class basic_ifstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ifstream<wchar_t>;
#endif
// ofstream
template class basic_ofstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ofstream<wchar_t>;
#endif
+ // fstream
+ template class basic_fstream<char>;
+ #ifdef _GLIBCPP_USE_WCHAR_T
+ template class basic_fstream<wchar_t>;
+ #endif
// istringstream
template class basic_istringstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_istringstream<wchar_t>;
#endif
// ostringstream
template class basic_ostringstream<char>;
#ifdef _GLIBCPP_USE_WCHAR_T
template class basic_ostringstream<wchar_t>;
#endif
+ // stringstream
+ template class basic_stringstream<char>;
+ #ifdef _GLIBCPP_USE_WCHAR_T
+ template class basic_stringstream<wchar_t>;
+ #endif
// string related to iostreams
template
basic_istream<char>&
operator>>(basic_istream<char>&, string&);
*************** namespace std
*** 240,248 ****
getline(basic_istream<wchar_t>&, wstring&);
#endif
- //
// algorithm
- //
typedef _Char_traits_match<char, char_traits<char> > char_match;
template
--- 227,233 ----
Index: src/string-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/string-inst.cc,v
retrieving revision 1.23
diff -c -p -r1.23 string-inst.cc
*** string-inst.cc 2002/01/04 21:27:36 1.23
--- string-inst.cc 2002/02/15 23:55:49
***************
*** 1,6 ****
// Components for manipulating sequences of characters -*- C++ -*-
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 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
--- 1,7 ----
// Components for manipulating sequences of characters -*- 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
*************** namespace std
*** 45,53 ****
typedef basic_string<C> S;
template class basic_string<C>;
- 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&);
--- 46,51 ----
More information about the Gcc-patches
mailing list