problem with strings in 970929

Dirk Herrmann dirk@ida.ing.tu-bs.de
Thu Oct 2 06:38:00 GMT 1997


Hi!

By patching egcs-970929/include/g++/string and 
egcs-970929/include/g++/std/bastring.h I made it compile. I have not
tested yet, though.

Best regards, 
Dirk Herrmann
----------------------------------------------------------------------
Beat the following spammer sites at their own game! SEND SPAM MAIL TO:
postmaster@agis.net postmaster@ascella.net


*** egcs-970929/include/g++/string    Wed Oct  1
14:26:04 1997
--- string      Wed Oct  1 15:34:00 1997
***************
*** 5,13 ****
  
  #include <std/bastring.h>
  
- extern "C++" {
- typedef basic_string <char> string;
- // typedef basic_string <wchar_t> wstring;
- } // extern "C++"
- 
  #endif
--- 5,8 ----
*** egcs-970929/include/g++/std/bastring.h    Wed Oct  1 14:26:14 1997
--- std/bastring.h      Wed Oct  1 15:33:25 1997
***************
*** 35,56 ****
  #include <cstddef>
  #include <std/straits.h>
  
- #ifdef __STL_USE_EXCEPTIONS
- 
- #include <stdexcept>
- #define OUTOFRANGE(cond) \
-   do { if (!(cond)) throw out_of_range (#cond); } while (0)
- #define LENGTHERROR(cond) \
-   do { if (!(cond)) throw length_error (#cond); } while (0)
- 
- #else
- 
- #include <cassert>
- #define OUTOFRANGE(cond) assert (!(cond))
- #define LENGTHERROR(cond) assert (!(cond))
- 
- #endif
- 
  extern "C++" {
  class istream; class ostream;
  
--- 35,40 ----
*************** public:
*** 278,293 ****
    reference operator[] (size_type pos)
      { unique (); return (*rep ())[pos]; }
  
!   reference at (size_type pos)
!     {
!       OUTOFRANGE (pos >= length ());
!       return (*this)[pos];
!     }
!   const_reference at (size_type pos) const
!     {
!       OUTOFRANGE (pos >= length ());
!       return data ()[pos];
!     }
  
  private:
    void terminate () const
--- 262,269 ----
    reference operator[] (size_type pos)
      { unique (); return (*rep ())[pos]; }
  
!   reference at (size_type pos);
!   const_reference at (size_type pos) const;
  
  private:
    void terminate () const
*************** private:
*** 382,387 ****
--- 358,399 ----
    static Rep nilRep;
    charT *dat;
  };
+ 
+ typedef basic_string <char> string;
+ 
+ #ifdef __STL_USE_EXCEPTIONS
+ 
+ #include <stdexcept>
+ #define OUTOFRANGE(cond) \
+   do { if (!(cond)) throw out_of_range (#cond); } while (0)
+ #define LENGTHERROR(cond) \
+   do { if (!(cond)) throw length_error (#cond); } while (0)
+ 
+ #else
+ 
+ #include <cassert>
+ #define OUTOFRANGE(cond) assert (!(cond))
+ #define LENGTHERROR(cond) assert (!(cond))
+ 
+ #endif
+ 
+ template <class charT, class traits> 
+ inline basic_string <charT, traits>::reference 
+ basic_string <charT, traits>::
+ at (size_type pos)
+ {
+   OUTOFRANGE (pos >= length ());
+   return (*this)[pos];
+ }
+ 
+ template <class charT, class traits> 
+ inline basic_string <charT, traits>::const_reference 
+ basic_string <charT, traits>::
+ at (size_type pos) const
+ {
+   OUTOFRANGE (pos >= length ());
+   return data ()[pos];
+ }
  
  #ifdef __STL_MEMBER_TEMPLATES
  template <class charT, class traits> template <class InputIterator>




More information about the Gcc-bugs mailing list