Hi, I'm writing a library that extends the stream classes. Since the standard instantiations of the iostream templates are already contained in libstdc++, I would expect these not to be incorporated into my library (i.e. marked "extern" in some header file). This is true for std::istream and std::ostream (and their wide counterparts), but not for std::iostream, which is instantiated and placed in my library. I believe that std::iostream and std::wiostream should be marked "extern". Simon
Note extern is a GCC extension. Also note that this is just size saving and nothing more. But I will let the libstdc++ people say if this is a good idea or not.
It looks like io-inst.cc does explicitly instatiate std::iostream for char, wchar_t. So, they should have extern bits in the headers as well. Fixed, thanks for reporting this. -benjamin
Subject: Bug 16715 CVSROOT: /cvs/gcc Module name: gcc Changes by: bkoz@gcc.gnu.org 2004-09-02 18:58:34 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: istream.tcc Log message: 2004-09-02 Benjamin Kosnik <bkoz@redhat.com> Simon Richter <Simon.Richter@hogyros.de> PR libstdc++/16715 * include/bits/istream.tcc: Add extern template for iostream char and wchar_t instantiations. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2652&r2=1.2653 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/istream.tcc.diff?cvsroot=gcc&r1=1.71&r2=1.72
Subject: Bug 16715 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: bkoz@gcc.gnu.org 2004-09-08 13:37:04 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: istream.tcc Log message: 2004-09-08 Benjamin Kosnik <bkoz@redhat.com> Simon Richter <Simon.Richter@hogyros.de> PR libstdc++/16715 * include/bits/istream.tcc: Add extern template for iostream char and wchar_t instantiations. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.171&r2=1.2224.2.172 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/istream.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.60.4.5&r2=1.60.4.6
Fixed for 3.4.3.