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]

[V3 PATCH] Fix for defect report libstdc++/1734


This patch eliminates some non-standard methods from char_traits<> 
that would have forced users who want to write their own character 
traits classes to use the same non-standard interface.


2001-02-13  Greg Bumgardner <bumgard@roguewave.com>

	* libstdc++-v3/include/bits/std_ostream.h: Replaced usage of
	_Traits::_S_eos() with _CharT() as per section 17.2.2.1.3.  
	* libstdc++-v3/include/bits/char_traits.h: Removed non-standard
	methods that cannot be used elsewhere.  

Index: gcc/libstdc++-v3/include/bits/char_traits.h
diff -c gcc/libstdc++-v3/include/bits/char_traits.h:1.1.1.1 gcc/libstdc++-v3/include/bits/char_traits.h:1.1.1.1.4.1
*** gcc/libstdc++-v3/include/bits/char_traits.h:1.1.1.1	Tue Feb 13 00:19:46 2001
--- gcc/libstdc++-v3/include/bits/char_traits.h	Tue Feb 13 09:56:25 2001
***************
*** 130,145 ****
        eq_int_type(const int_type& __c1, const int_type& __c2)
        { return __c1 == __c2; }
  
-       static state_type 
-       _S_get_state(const pos_type& __pos) { return __pos.state(); }
- 
        static int_type 
        eof() { return static_cast<int_type>(-1); }
  
        static int_type 
-       _S_eos() { return char_type(); }
- 
-       static int_type 
        not_eof(const int_type& __c)
        { return eq_int_type(__c, eof()) ? int_type(0) : __c; }
      };
--- 130,139 ----
***************
*** 205,220 ****
        eq_int_type(const int_type& __c1, const int_type& __c2)
        { return __c1 == __c2; }
  
-       static state_type 
-       _S_get_state(const pos_type& __pos) { return __pos.state(); }
- 
        static int_type 
        eof() { return static_cast<int_type>(EOF); }
  
        static int_type 
-       _S_eos() { return char_type(); }
- 
-       static int_type 
        not_eof(const int_type& __c)
        { return (__c == eof()) ? 0 : __c; }
    };
--- 199,208 ----
***************
*** 276,289 ****
        eq_int_type(const int_type& __c1, const int_type& __c2)
        { return __c1 == __c2; }
  
-       static state_type 
-       _S_get_state(const pos_type& __pos) { return __pos.state(); }
- 
        static int_type 
        eof() { return static_cast<int_type>(WEOF); }
- 
-       static int_type 
-       _S_eos() { return char_type(); }
  
        static int_type 
        not_eof(const int_type& __c)
--- 264,271 ----
Index: gcc/libstdc++-v3/include/bits/std_ostream.h
diff -c gcc/libstdc++-v3/include/bits/std_ostream.h:1.1.1.1 gcc/libstdc++-v3/include/bits/std_ostream.h:1.1.1.1.4.1
*** gcc/libstdc++-v3/include/bits/std_ostream.h:1.1.1.1	Tue Feb 13 00:21:22 2001
--- gcc/libstdc++-v3/include/bits/std_ostream.h	Tue Feb 13 10:02:04 2001
***************
*** 262,268 ****
    template<typename _CharT, typename _Traits>
      basic_ostream<_CharT, _Traits>& 
      ends(basic_ostream<_CharT, _Traits>& __os)
!     { return __os.put(_Traits::_S_eos()); }
    
    template<typename _CharT, typename _Traits>
      basic_ostream<_CharT, _Traits>& 
--- 262,268 ----
    template<typename _CharT, typename _Traits>
      basic_ostream<_CharT, _Traits>& 
      ends(basic_ostream<_CharT, _Traits>& __os)
!     { return __os.put(_CharT()); }
    
    template<typename _CharT, typename _Traits>
      basic_ostream<_CharT, _Traits>& 


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