]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Bring egcs-1.0.2's libstdc++ up to libstdc++ 2.8.0.
authorJeff Law <law@gcc.gnu.org>
Sun, 8 Feb 1998 23:13:33 +0000 (16:13 -0700)
committerJeff Law <law@gcc.gnu.org>
Sun, 8 Feb 1998 23:13:33 +0000 (16:13 -0700)
From-SVN: r17789

libstdc++/ChangeLog
libstdc++/Makefile.in
libstdc++/configure.in
libstdc++/std/bastring.cc
libstdc++/std/bastring.h
libstdc++/stlinst.cc
libstdc++/testsuite/ChangeLog
libstdc++/testsuite/lib/libstdc++.exp

index d0ac79481c85dc18db097e7b90bda90fc00e2321..cc0872b02774cce17ce963423766184481a28911 100644 (file)
@@ -3,10 +3,51 @@ Mon Feb  9 00:09:16 1998  Jason Merrill  <jason@yorick.cygnus.com>
        * Makefile.in (install): Remove the shared library symlink even if
        we aren't installing it.
 
+1998-01-05  Brendan Kehoe  <brendan@lisa.cygnus.com>
+
+       * std/bastring.cc (basic_string::Rep::operator delete): Don't claim
+       to return from deallocate, since this is a void method.
+
+Sat Jan  3 12:15:41 1998 Franz Sirl <franz.sirl-kernel@lauterbach.com>
+
+       * configure.in: Finalize support for {alpha|powerpc}*-*-linux-gnulibc1
+
+Sun Dec  7 02:34:40 1997  Jody Goldberg        <jodyg@idt.net>
+
+       * libstdc++/std/bastring.h : Move closer to the draft standard
+       implementation of basic_string by adding 3 paramter 'Allocator'.
+       NOTE: this still differs from the standard in not offering per
+       instance allocators.
+       * libstdc++/std/bastring.cc : Likewise.
+       * libstdc++/stlinst.cc : Handle thread safe allocators if they are the
+       default.
+
+Sun Dec  7 02:32:20 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * iosfwd: New header.
+       * Makefile.in (HEADERS): Add it.
+
+Sun Dec  7 02:32:20 1997  Gregory L. Galloway (gregg@eoeml.gtri.gatech.edu)
+
+       * Makefile.in (HEADERS): Modified list of headers to 
+       install to include all of SGI STL headers especially hash_set and 
+       hash_map, and added ANSI C++ style wrappers for fstream, iomanip, 
+       iostream, and strstream.
+
+       * fstream, iomanip, iostream, strstream: New forwarding headers
+       added.
+
 Thu Nov 27 01:33:55 1997  Jeffrey A Law  (law@cygnus.com)
 
        * Makefile.in (install): Change gxx_includedir to gxx_include_dir.
 
+Tue Nov 25 23:16:44 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       London changes to string:
+       * std/bastring.cc (check_realloc): Don't be selfish anymore.
+       * std/bastring.h (non-const operator[]): Be selfish.
+       (iterator forms of insert and erase): Stay selfish.
+
 Tue Nov 25 14:03:43 1997  H.J. Lu  (hjl@gnu.org)
 
        * Makefile.in (stmp-complex, bigstmp-complex): Changed to
index 473037aeebc52698a41809d0f470a4e1f7d75308..0ae2705601616dc7639ca83cfc0df4c44bbd700d 100644 (file)
@@ -23,8 +23,9 @@ SUBLIBS = $(STAMP)-string $(STAMP)-complx
 HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
         csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
         cwchar cwctype string stdexcept \
-        algorithm deque list map queue set stack vector utility functional \
-        iterator memory numeric
+        algorithm deque functional hash_map hash_set iterator list map \
+        memory numeric pthread_alloc queue rope set slist stack utility \
+        vector fstream iomanip iostream strstream iosfwd
 
 ARLIB   = libstdc++.a
 SHLIB   = libstdc++.so.$(VERSION)
@@ -301,17 +302,15 @@ force:
 stuff:
        $(MAKE) clean
        $(MAKE) -C ../libio c++clean
-       $(MAKE) -C ../libg++ clean
-       $(MAKE) $(MAKEFLAGS) check
-       $(MAKE) -C ../libio check
-       $(MAKE) -C ../libg++ check
+       -$(MAKE) $(MAKEFLAGS) check
+       -$(MAKE) -C ../libio check
+       -$(MAKE) -C ../../gcc check-g++
 
 stuff1:
        $(MAKE) clean
        $(MAKE) -C ../libio c++clean
-       $(MAKE) -C ../libg++ clean
 
 stuff2:
-       $(MAKE) check
-       $(MAKE) -C ../libio check
-       $(MAKE) -C ../libg++ check
+       -$(MAKE) check
+       -$(MAKE) -C ../libio check
+       -$(MAKE) -C ../../gcc check-g++
index 9ec0ac10482d97e15546cf85ba7c035d2a3b5fdd..efc2f55cd13f0d3bb72ae8fc19d7d93cc07e8b4d 100644 (file)
@@ -43,8 +43,10 @@ fi
 
 # Make sure the right flags are defined for multi-threading.
 case "${target}" in
-  *-*-linux-gnu)       frags="${frags} linux.mt" ;;
-  m68k-motorola-sysv)  frags="${frags} delta.mt" ;;
+  alpha*-*-linux-gnulibc1)     frags="${frags} linux.mt" ;;
+  powerpc*-*-linux-gnulibc1)   frags="${frags} linux.mt" ;;
+  *-*-linux-gnu)               frags="${frags} linux.mt" ;;
+  m68k-motorola-sysv)          frags="${frags} delta.mt" ;;
 esac
 
 for frag in ${frags}; do
index aa151da69d1b6099214fb6d38bd5aff71463f5dd..7556ed9c60937fc205e5bf9c924b3486a30c72ca 100644 (file)
 #include <std/bastring.h>
 
 extern "C++" {
-template <class charT, class traits>
-inline void * basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+inline void * basic_string <charT, traits, Allocator>::Rep::
 operator new (size_t s, size_t extra)
 {
-  return ::operator new (s + extra * sizeof (charT));
+  return Allocator::allocate(s + extra * sizeof (charT));
 }
 
-template <class charT, class traits>
-inline size_t basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+inline void basic_string <charT, traits, Allocator>::Rep::
+operator delete (void * ptr)
+{
+  Allocator::deallocate(ptr, sizeof(Rep) +
+                       reinterpret_cast<Rep *>(ptr)->res *
+                       sizeof (charT)); 
+}
+
+template <class charT, class traits, class Allocator>
+inline size_t basic_string <charT, traits, Allocator>::Rep::
 #if _G_ALLOC_CONTROL
 default_frob (size_t s)
 #else
@@ -49,8 +58,9 @@ frob_size (size_t s)
   return i;
 }
 
-template <class charT, class traits>
-inline basic_string <charT, traits>::Rep * basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+inline basic_string <charT, traits, Allocator>::Rep *
+basic_string <charT, traits, Allocator>::Rep::
 create (size_t extra)
 {
   extra = frob_size (extra + 1);
@@ -61,8 +71,8 @@ create (size_t extra)
   return p;
 }
 
-template <class charT, class traits>
-charT * basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+charT * basic_string <charT, traits, Allocator>::Rep::
 clone ()
 {
   Rep *p = Rep::create (len);
@@ -71,8 +81,8 @@ clone ()
   return p->data ();
 }
 
-template <class charT, class traits>
-inline bool basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+inline bool basic_string <charT, traits, Allocator>::Rep::
 #ifdef _G_ALLOC_CONTROL
 default_excess (size_t s, size_t r)
 #else
@@ -82,19 +92,20 @@ excess_slop (size_t s, size_t r)
   return 2 * (s <= 16 ? 16 : s) < r;
 }
 
-template <class charT, class traits>
-inline bool basic_string <charT, traits>::
-check_realloc (size_t s) const
+template <class charT, class traits, class Allocator>
+inline bool basic_string <charT, traits, Allocator>::
+check_realloc (basic_string::size_type s) const
 {
   s += sizeof (charT);
+  rep ()->selfish = false;
   return (rep ()->ref > 1
          || s > capacity ()
          || Rep::excess_slop (s, capacity ()));
 }
 
-template <class charT, class traits>
-void basic_string <charT, traits>::
-alloc (size_t size, bool save)
+template <class charT, class traits, class Allocator>
+void basic_string <charT, traits, Allocator>::
+alloc (basic_string::size_type size, bool save)
 {
   if (! check_realloc (size))
     return;
@@ -112,10 +123,11 @@ alloc (size_t size, bool save)
   repup (p);
 }
 
-template <class charT, class traits>
-basic_string <charT, traits>& basic_string <charT, traits>::
-replace (size_t pos1, size_t n1,
-        const basic_string& str, size_t pos2, size_t n2)
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>&
+basic_string <charT, traits, Allocator>::
+replace (size_type pos1, size_type n1,
+        const basic_string& str, size_type pos2, size_type n2)
 {
   const size_t len2 = str.length ();
 
@@ -130,27 +142,28 @@ replace (size_t pos1, size_t n1,
   return replace (pos1, n1, str.data () + pos2, n2);
 }
 
-template <class charT, class traits>
-inline void basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+inline void basic_string <charT, traits, Allocator>::Rep::
 copy (size_t pos, const charT *s, size_t n)
 {
   if (n)
     traits::copy (data () + pos, s, n);
 }
 
-template <class charT, class traits>
-inline void basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+inline void basic_string <charT, traits, Allocator>::Rep::
 move (size_t pos, const charT *s, size_t n)
 {
   if (n)
     traits::move (data () + pos, s, n);
 }
 
-template <class charT, class traits>
-basic_string <charT, traits>& basic_string <charT, traits>::
-replace (size_t pos, size_t n1, const charT* s, size_t n2)
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>&
+basic_string <charT, traits, Allocator>::
+replace (size_type pos, size_type n1, const charT* s, size_type n2)
 {
-  const size_t len = length ();
+  const size_type len = length ();
   OUTOFRANGE (pos > len);
   if (n1 > len - pos)
     n1 = len - pos;
@@ -175,16 +188,16 @@ replace (size_t pos, size_t n1, const charT* s, size_t n2)
   return *this;
 }
 
-template <class charT, class traits>
-inline void basic_string <charT, traits>::Rep::
+template <class charT, class traits, class Allocator>
+inline void basic_string <charT, traits, Allocator>::Rep::
 set (size_t pos, const charT c, size_t n)
 {
   traits::set  (data () + pos, c, n);
 }
 
-template <class charT, class traits>
-basic_string <charT, traits>& basic_string <charT, traits>::
-replace (size_t pos, size_t n1, size_t n2, charT c)
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
+replace (size_type pos, size_type n1, size_type n2, charT c)
 {
   const size_t len = length ();
   OUTOFRANGE (pos > len);
@@ -211,9 +224,9 @@ replace (size_t pos, size_t n1, size_t n2, charT c)
   return *this;
 }
 
-template <class charT, class traits>
-void basic_string <charT, traits>::
-resize (size_t n, charT c)
+template <class charT, class traits, class Allocator>
+void basic_string <charT, traits, Allocator>::
+resize (size_type n, charT c)
 {
   LENGTHERROR (n > max_size ());
 
@@ -223,9 +236,10 @@ resize (size_t n, charT c)
     erase (n);
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-copy (charT* s, size_t n, size_t pos)
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+copy (charT* s, size_type n, size_type pos)
 {
   OUTOFRANGE (pos > length ());
 
@@ -236,9 +250,10 @@ copy (charT* s, size_t n, size_t pos)
   return n;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find (const charT* s, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find (const charT* s, size_type pos, size_type n) const
 {
   size_t xpos = pos;
   for (; xpos + n <= length (); ++xpos)
@@ -248,9 +263,10 @@ find (const charT* s, size_t pos, size_t n) const
   return npos;
 }
 
-template <class charT, class traits>
-inline size_t basic_string <charT, traits>::
-_find (const charT* ptr, charT c, size_t xpos, size_t len)
+template <class charT, class traits, class Allocator>
+inline basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+_find (const charT* ptr, charT c, size_type xpos, size_type len)
 {
   for (; xpos < len; ++xpos)
     if (traits::eq (ptr [xpos], c))
@@ -258,16 +274,18 @@ _find (const charT* ptr, charT c, size_t xpos, size_t len)
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find (charT c, size_t pos) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find (charT c, size_type pos) const
 {
   return _find (data (), c, pos, length ());
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-rfind (const charT* s, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+rfind (const charT* s, size_type pos, size_type n) const
 {
   if (n > length ())
     return npos;
@@ -283,9 +301,10 @@ rfind (const charT* s, size_t pos, size_t n) const
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-rfind (charT c, size_t pos) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+rfind (charT c, size_type pos) const
 {
   if (1 > length ())
     return npos;
@@ -300,9 +319,10 @@ rfind (charT c, size_t pos) const
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_first_of (const charT* s, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find_first_of (const charT* s, size_type pos, size_type n) const
 {
   size_t xpos = pos;
   for (; xpos < length (); ++xpos)
@@ -311,9 +331,10 @@ find_first_of (const charT* s, size_t pos, size_t n) const
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_last_of (const charT* s, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find_last_of (const charT* s, size_type pos, size_type n) const
 {
   size_t xpos = length () - 1;
   if (xpos > pos)
@@ -324,9 +345,10 @@ find_last_of (const charT* s, size_t pos, size_t n) const
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_first_not_of (const charT* s, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find_first_not_of (const charT* s, size_type pos, size_type n) const
 {
   size_t xpos = pos;
   for (; xpos < length (); ++xpos)
@@ -335,9 +357,10 @@ find_first_not_of (const charT* s, size_t pos, size_t n) const
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_first_not_of (charT c, size_t pos) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find_first_not_of (charT c, size_type pos) const
 {
   size_t xpos = pos;
   for (; xpos < length (); ++xpos)
@@ -346,9 +369,10 @@ find_first_not_of (charT c, size_t pos) const
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_last_not_of (const charT* s, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find_last_not_of (const charT* s, size_type pos, size_type n) const
 {
   size_t xpos = length () - 1;
   if (xpos > pos)
@@ -359,9 +383,10 @@ find_last_not_of (const charT* s, size_t pos, size_t n) const
   return npos;
 }
 
-template <class charT, class traits>
-size_t basic_string <charT, traits>::
-find_last_not_of (charT c, size_t pos) const
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::
+find_last_not_of (charT c, size_type pos) const
 {
   size_t xpos = length () - 1;
   if (xpos > pos)
@@ -372,9 +397,9 @@ find_last_not_of (charT c, size_t pos) const
   return npos;
 }
 
-template <class charT, class traits>
-int basic_string <charT, traits>::
-compare (const basic_string& str, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+int basic_string <charT, traits, Allocator>::
+compare (const basic_string& str, size_type pos, size_type n) const
 {
   OUTOFRANGE (pos > length ());
 
@@ -391,9 +416,9 @@ compare (const basic_string& str, size_t pos, size_t n) const
   return (length () - pos) - str.length ();
 }
 
-template <class charT, class traits>
-int basic_string <charT, traits>::
-compare (const charT* s, size_t pos, size_t n) const
+template <class charT, class traits, class Allocator>
+int basic_string <charT, traits, Allocator>::
+compare (const charT* s, size_type pos, size_type n) const
 {
   OUTOFRANGE (pos > length ());
 
@@ -408,9 +433,9 @@ compare (const charT* s, size_t pos, size_t n) const
 
 #include <iostream.h>
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 istream &
-operator>> (istream &is, basic_string <charT, traits> &s)
+operator>> (istream &is, basic_string <charT, traits, Allocator> &s)
 {
   int w = is.width (0);
   if (is.ipfx0 ())
@@ -443,16 +468,16 @@ operator>> (istream &is, basic_string <charT, traits> &s)
   return is;
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 ostream &
-operator<< (ostream &o, const basic_string <charT, traits>& s)
+operator<< (ostream &o, const basic_string <charT, traits, Allocator>& s)
 {
   return o.write (s.data (), s.length ());
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 istream&
-getline (istream &is, basic_string <charT, traits>& s, charT delim)
+getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim)
 {
   if (is.ipfx1 ())
     {
@@ -493,22 +518,22 @@ getline (istream &is, basic_string <charT, traits>& s, charT delim)
   return is;
 }
 
-template <class charT, class traits>
-basic_string <charT, traits>::Rep
-basic_string<charT, traits>::nilRep = { 0, 0, 1 };
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>::Rep
+basic_string<charT, traits, Allocator>::nilRep = { 0, 0, 1 };
 
-template <class charT, class traits>
-const basic_string <charT, traits>::size_type
-basic_string <charT, traits>::npos;
+template <class charT, class traits, class Allocator>
+const basic_string <charT, traits, Allocator>::size_type
+basic_string <charT, traits, Allocator>::npos;
 
 #ifdef _G_ALLOC_CONTROL
-template <class charT, class traits>
-bool (*basic_string <charT, traits>::Rep::excess_slop) (size_t, size_t)
-     = basic_string <charT, traits>::Rep::default_excess;
+template <class charT, class traits, class Allocator>
+bool (*basic_string <charT, traits, Allocator>::Rep::excess_slop) (size_t, size_t)
+     = basic_string <charT, traits, Allocator>::Rep::default_excess;
 
-template <class charT, class traits>
-size_t (*basic_string <charT, traits>::Rep::frob_size) (size_t)
-     = basic_string <charT, traits>::Rep::default_frob;
+template <class charT, class traits, class Allocator>
+size_t (*basic_string <charT, traits, Allocator>::Rep::frob_size) (size_t)
+     = basic_string <charT, traits, Allocator>::Rep::default_frob;
 #endif
 
 } // extern "C++"
index 59a599583028cfbcb70dd90911a524a689ae72a5..5b1d651e00f0f4ffedefb8ca173c3b04b3a6b92a 100644 (file)
@@ -35,6 +35,9 @@
 #include <cstddef>
 #include <std/straits.h>
 
+// NOTE : This does NOT conform to the draft standard and is likely to change
+#include <alloc.h>
+
 extern "C++" {
 class istream; class ostream;
 
@@ -58,7 +61,8 @@ extern void __length_error (const char *);
 
 #endif
 
-template <class charT, class traits = string_char_traits<charT> >
+template <class charT, class traits = string_char_traits<charT>,
+         class Allocator = alloc >
 class basic_string
 {
 private:
@@ -72,6 +76,7 @@ private:
     void release () { if (--ref == 0) delete this; }
 
     inline static void * operator new (size_t, size_t);
+    inline static void operator delete (void *);
     inline static Rep* create (size_t);
     charT* clone ();
 
@@ -102,8 +107,10 @@ private:
 
 public:
 // types:
-  typedef traits traits_type;
-  typedef charT value_type;
+  typedef         traits               traits_type;
+  typedef typename traits::char_type   value_type;
+  typedef         Allocator            allocator_type;
+
   typedef size_t size_type;
   typedef ptrdiff_t difference_type;
   typedef charT& reference;
@@ -220,9 +227,9 @@ public:
   basic_string& insert (size_type pos, size_type n, charT c)
     { return replace (pos, 0, n, c); }
   iterator insert(iterator p, charT c)
-    { insert (p - ibegin (), 1, c); return p; }
+    { insert (p - ibegin (), 1, c); selfish (); return p; }
   iterator insert(iterator p, size_type n, charT c)
-    { insert (p - ibegin (), n, c); return p; }
+    { insert (p - ibegin (), n, c); selfish (); return p; }
 #ifdef __STL_MEMBER_TEMPLATES
   template<class InputIterator>
     void insert(iterator p, InputIterator first, InputIterator last)
@@ -234,9 +241,9 @@ public:
   basic_string& erase (size_type pos = 0, size_type n = npos)
     { return replace (pos, n, (size_type)0, (charT)0); }
   iterator erase(iterator p)
-    { replace (p - ibegin (), 1, (size_type)0, (charT)0); return p; }
+    { replace (p-ibegin (), 1, (size_type)0, (charT)0); selfish (); return p; }
   iterator erase(iterator f, iterator l)
-    { replace (f - ibegin (), l - f, (size_type)0, (charT)0); return f; }
+    { replace (f-ibegin (), l-f, (size_type)0, (charT)0);selfish ();return f; }
 
   basic_string& replace (size_type pos1, size_type n1, const basic_string& str,
                         size_type pos2 = 0, size_type n2 = npos);
@@ -278,7 +285,7 @@ public:
     }
 
   reference operator[] (size_type pos)
-    { unique (); return (*rep ())[pos]; }
+    { selfish (); return (*rep ())[pos]; }
 
   reference at (size_type pos)
     {
@@ -386,12 +393,12 @@ private:
 };
 
 #ifdef __STL_MEMBER_TEMPLATES
-template <class charT, class traits> template <class InputIterator>
-basic_string <charT, traits>& basic_string <charT, traits>::
+template <class charT, class traits, class Allocator> template <class InputIterator>
+basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
 replace (iterator i1, iterator i2, InputIterator j1, InputIterator j2)
 #else
-template <class charT, class traits>
-basic_string <charT, traits>& basic_string <charT, traits>::
+template <class charT, class traits, class Allocator>
+basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
 replace (iterator i1, iterator i2, const_iterator j1, const_iterator j2)
 #endif
 {
@@ -426,191 +433,191 @@ replace (iterator i1, iterator i2, const_iterator j1, const_iterator j2)
   return *this;
 }
 
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const basic_string <charT, traits>& lhs,
-          const basic_string <charT, traits>& rhs)
+template <class charT, class traits, class Allocator>
+inline basic_string <charT, traits, Allocator>
+operator+ (const basic_string <charT, traits, Allocator>& lhs,
+          const basic_string <charT, traits, Allocator>& rhs)
 {
-  basic_string <charT, traits> str (lhs);
+  basic_string <charT, traits, Allocator> str (lhs);
   str.append (rhs);
   return str;
 }
 
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const charT* lhs, const basic_string <charT, traits>& rhs)
+template <class charT, class traits, class Allocator>
+inline basic_string <charT, traits, Allocator>
+operator+ (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
-  basic_string <charT, traits> str (lhs);
+  basic_string <charT, traits, Allocator> str (lhs);
   str.append (rhs);
   return str;
 }
 
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (charT lhs, const basic_string <charT, traits>& rhs)
+template <class charT, class traits, class Allocator>
+inline basic_string <charT, traits, Allocator>
+operator+ (charT lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
-  basic_string <charT, traits> str (1, lhs);
+  basic_string <charT, traits, Allocator> str (1, lhs);
   str.append (rhs);
   return str;
 }
 
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const basic_string <charT, traits>& lhs, const charT* rhs)
+template <class charT, class traits, class Allocator>
+inline basic_string <charT, traits, Allocator>
+operator+ (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
 {
-  basic_string <charT, traits> str (lhs);
+  basic_string <charT, traits, Allocator> str (lhs);
   str.append (rhs);
   return str;
 }
 
-template <class charT, class traits>
-inline basic_string <charT, traits>
-operator+ (const basic_string <charT, traits>& lhs, charT rhs)
+template <class charT, class traits, class Allocator>
+inline basic_string <charT, traits, Allocator>
+operator+ (const basic_string <charT, traits, Allocator>& lhs, charT rhs)
 {
-  basic_string <charT, traits> str (lhs);
+  basic_string <charT, traits, Allocator> str (lhs);
   str.append (1, rhs);
   return str;
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator== (const basic_string <charT, traits>& lhs,
-           const basic_string <charT, traits>& rhs)
+operator== (const basic_string <charT, traits, Allocator>& lhs,
+           const basic_string <charT, traits, Allocator>& rhs)
 {
   return (lhs.compare (rhs) == 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator== (const charT* lhs, const basic_string <charT, traits>& rhs)
+operator== (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
   return (rhs.compare (lhs) == 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator== (const basic_string <charT, traits>& lhs, const charT* rhs)
+operator== (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
 {
   return (lhs.compare (rhs) == 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator!= (const charT* lhs, const basic_string <charT, traits>& rhs)
+operator!= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
   return (rhs.compare (lhs) != 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator!= (const basic_string <charT, traits>& lhs, const charT* rhs)
+operator!= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
 {
   return (lhs.compare (rhs) != 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator< (const basic_string <charT, traits>& lhs,
-           const basic_string <charT, traits>& rhs)
+operator< (const basic_string <charT, traits, Allocator>& lhs,
+           const basic_string <charT, traits, Allocator>& rhs)
 {
   return (lhs.compare (rhs) < 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator< (const charT* lhs, const basic_string <charT, traits>& rhs)
+operator< (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
   return (rhs.compare (lhs) > 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator< (const basic_string <charT, traits>& lhs, const charT* rhs)
+operator< (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
 {
   return (lhs.compare (rhs) < 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator> (const charT* lhs, const basic_string <charT, traits>& rhs)
+operator> (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
   return (rhs.compare (lhs) < 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator> (const basic_string <charT, traits>& lhs, const charT* rhs)
+operator> (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
 {
   return (lhs.compare (rhs) > 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator<= (const charT* lhs, const basic_string <charT, traits>& rhs)
+operator<= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
   return (rhs.compare (lhs) >= 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator<= (const basic_string <charT, traits>& lhs, const charT* rhs)
+operator<= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
 {
   return (lhs.compare (rhs) <= 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator>= (const charT* lhs, const basic_string <charT, traits>& rhs)
+operator>= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
 {
   return (rhs.compare (lhs) <= 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator>= (const basic_string <charT, traits>& lhs, const charT* rhs)
+operator>= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
 {
   return (lhs.compare (rhs) >= 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator!= (const basic_string <charT, traits>& lhs,
-           const basic_string <charT, traits>& rhs)
+operator!= (const basic_string <charT, traits, Allocator>& lhs,
+           const basic_string <charT, traits, Allocator>& rhs)
 {
   return (lhs.compare (rhs) != 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator> (const basic_string <charT, traits>& lhs,
-          const basic_string <charT, traits>& rhs)
+operator> (const basic_string <charT, traits, Allocator>& lhs,
+          const basic_string <charT, traits, Allocator>& rhs)
 {
   return (lhs.compare (rhs) > 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator<= (const basic_string <charT, traits>& lhs,
-           const basic_string <charT, traits>& rhs)
+operator<= (const basic_string <charT, traits, Allocator>& lhs,
+           const basic_string <charT, traits, Allocator>& rhs)
 {
   return (lhs.compare (rhs) <= 0);
 }
 
-template <class charT, class traits>
+template <class charT, class traits, class Allocator>
 inline bool
-operator>= (const basic_string <charT, traits>& lhs,
-           const basic_string <charT, traits>& rhs)
+operator>= (const basic_string <charT, traits, Allocator>& lhs,
+           const basic_string <charT, traits, Allocator>& rhs)
 {
   return (lhs.compare (rhs) >= 0);
 }
 
 class istream; class ostream;
-template <class charT, class traits> istream&
-operator>> (istream&, basic_string <charT, traits>&);
-template <class charT, class traits> ostream&
-operator<< (ostream&, const basic_string <charT, traits>&);
-template <class charT, class traits> istream&
-getline (istream&, basic_string <charT, traits>&, charT delim = '\n');
+template <class charT, class traits, class Allocator> istream&
+operator>> (istream&, basic_string <charT, traits, Allocator>&);
+template <class charT, class traits, class Allocator> ostream&
+operator<< (ostream&, const basic_string <charT, traits, Allocator>&);
+template <class charT, class traits, class Allocator> istream&
+getline (istream&, basic_string <charT, traits, Allocator>&, charT delim = '\n');
 
 } // extern "C++"
 
index dc55ce3227475441c270097f15338f750e5bbc63..03242fabb7d4f5b1123b72623858c18cb86ba6fa 100644 (file)
@@ -1,8 +1 @@
-// Instantiation file for the -*- C++ -*- Standard Library allocator templates
-// This file is part of the GNU ANSI C++ Library.
-
-#include <alloc.h>
-
-template class __default_alloc_template<false, 0>;
-
-template class  __malloc_alloc_template<0>;
+template class __default_alloc_template<__NODE_ALLOCATOR_THREADS, 0>;
index 886f8b0a6851d507dbe839692f9b75dee15df125..84d8290c719432c6b76201df1cc96382b2056acf 100644 (file)
@@ -1,3 +1,8 @@
+Thu Dec 25 00:34:03 1997  Jeffrey A Law  (law@cygnus.com)
+
+       * lib/libstdc++.exp (test_libstdc++): Set LD_LIBRARY_PATH
+       and SHLIB_PATH appropriately.
+
 Wed Sep  3 09:39:36 1997  Jeffrey A Law  (law@cygnus.com)
 
        * lib/libstdc++.exp: Remove libg++_link_flags.
index 91cd83025b9aa2a977739591e68b3feb6e3e740e..f9bcdf43602c9f47d2a3ecc9e44f0d7b0160ac1d 100644 (file)
@@ -73,6 +73,23 @@ proc test_libstdc++ { options srcfile compile_args inpfile resultfile exec_args
 
     verbose "using LIBSTDCPP = $libstdcpp" 2
     set args ""
+
+    # Basically we want to build up a colon separated path list from
+    # the value of $libstdcpp.
+
+    # First strip away any -L arguments.
+    regsub -all -- "-L" $libstdcpp "" ld_library_path
+
+    # Then remove any -lstdc++ argument.
+    regsub -all -- " -lstdc.*" $ld_library_path "" ld_library_path
+
+    # That's enough to make things work for the normal case.
+    # If we wanted to handle an arbitrary value of libstdcpp,
+    # then we'd have to do a lot more work.
+
+    # Set variables the dynamic linker looks at.
+    setenv LD_LIBRARY_PATH $ld_library_path
+    setenv SHLIB_PATH $ld_library_path
     if { $compile_args != "" } {
        lappend args "additional_flags=$compile_args"
     }