This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Little more stream inline tweaks


Hi,

tested x86-linux, committed to mainline.

Paolo.

/////////////////

2006-10-15  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/istream.tcc (getline(basic_istream<>&,
	basic_string<>&)): Move...
	* include/bits/basic_string.h: ... here.
	(operator<<(basic_ostream<>&, const basic_string<>&)): Mark inline.

Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 117742)
+++ include/bits/basic_string.h	(working copy)
@@ -2394,7 +2394,7 @@
    *  writing a C string.
    */
   template<typename _CharT, typename _Traits, typename _Alloc>
-    basic_ostream<_CharT, _Traits>&
+    inline basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os,
 	       const basic_string<_CharT, _Traits, _Alloc>& __str)
     {
@@ -2436,8 +2436,9 @@
   template<typename _CharT, typename _Traits, typename _Alloc>
     inline basic_istream<_CharT, _Traits>&
     getline(basic_istream<_CharT, _Traits>& __is,
-	    basic_string<_CharT, _Traits, _Alloc>& __str);
-    
+	    basic_string<_CharT, _Traits, _Alloc>& __str)
+    { return getline(__is, __str, __is.widen('\n')); }
+
   template<>
     basic_istream<char>&
     getline(basic_istream<char>& __in, basic_string<char>& __str,
Index: include/bits/istream.tcc
===================================================================
--- include/bits/istream.tcc	(revision 117742)
+++ include/bits/istream.tcc	(working copy)
@@ -988,12 +988,6 @@
       return __in;
     }
 
-  template<class _CharT, class _Traits, class _Alloc>
-    inline basic_istream<_CharT,_Traits>&
-    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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]