public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* string and member templates
@ 1997-09-25 16:45 Joe Buck
  1997-09-26  8:36 ` Oleg Krivosheev
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Buck @ 1997-09-25 16:45 UTC (permalink / raw)
  To: egcs team

I see that the member template code in std/bastring.h is ifdef'ed out
with #if 0.  I suggest that this be changed to

#ifdef __STL_MEMBER_TEMPLATES

to match the STL classes; that way the flag can be set only once (e.g.
one way for egcs, the other for gcc2 snapshots until member templates
are merged).

#include <stl_config.h> to pick up the definition.

Here's a patch; I've verified that tstring still works, though it
doesn't really exercise these functions.

*** bastring.h.970924	Mon Sep 22 13:57:12 1997
--- bastring.h	Thu Sep 25 16:36:49 1997
***************
*** 34,39 ****
--- 34,40 ----
  
  #include <cstddef>
  #include <std/straits.h>
+ #include <stl_config.h>
  
  #if _G_USE_EXCEPTIONS
  
***************
*** 149,155 ****
      : dat (nilRep.grab ()) { assign (s); }
    basic_string (size_type n, charT c)
      : dat (nilRep.grab ()) { assign (n, c); }
! #if 0
    template<class InputIterator>
      basic_string(InputIterator begin, InputIterator end,
  		 Allocator& = Allocator());
--- 150,156 ----
      : dat (nilRep.grab ()) { assign (s); }
    basic_string (size_type n, charT c)
      : dat (nilRep.grab ()) { assign (n, c); }
! #ifdef __STL_MEMBER_TEMPLATES
    template<class InputIterator>
      basic_string(InputIterator begin, InputIterator end,
  		 Allocator& = Allocator());
***************
*** 172,178 ****
      { return append (s, traits::length (s)); }
    basic_string& append (size_type n, charT c)
      { return replace (length (), 0, n, c); }
! #if 0
    template<class InputIterator>
      basic_string& append(InputIterator first, InputIterator last);
  #else
--- 173,179 ----
      { return append (s, traits::length (s)); }
    basic_string& append (size_type n, charT c)
      { return replace (length (), 0, n, c); }
! #ifdef __STL_MEMBER_TEMPLATES
    template<class InputIterator>
      basic_string& append(InputIterator first, InputIterator last);
  #else
***************
*** 189,195 ****
      { return assign (s, traits::length (s)); }
    basic_string& assign (size_type n, charT c)
      { return replace (0, npos, n, c); }
! #if 0
    template<class InputIterator>
      basic_string& assign(InputIterator first, InputIterator last);
  #else
--- 190,196 ----
      { return assign (s, traits::length (s)); }
    basic_string& assign (size_type n, charT c)
      { return replace (0, npos, n, c); }
! #ifdef __STL_MEMBER_TEMPLATES
    template<class InputIterator>
      basic_string& assign(InputIterator first, InputIterator last);
  #else
***************
*** 222,228 ****
      { size_type pos = p - begin (); insert (pos, 1, c); return pos +begin (); }
    iterator insert(iterator p, size_type n, charT c)
      { size_type pos = p - begin (); insert (pos, n, c); return pos +begin (); }
! #if 0
    template<class InputIterator>
      void insert(iterator p, InputIterator first, InputIterator last);
  #else
--- 223,229 ----
      { size_type pos = p - begin (); insert (pos, 1, c); return pos +begin (); }
    iterator insert(iterator p, size_type n, charT c)
      { size_type pos = p - begin (); insert (pos, n, c); return pos +begin (); }
! #ifdef __STL_MEMBER_TEMPLATES
    template<class InputIterator>
      void insert(iterator p, InputIterator first, InputIterator last);
  #else
***************
*** 254,260 ****
      { return replace (i1 - begin (), i2 - i1, s); }
    basic_string& replace (iterator i1, iterator i2, size_type n, charT c)
      { return replace (i1 - begin (), i2 - i1, n, c); }
! #if 0
    template<class InputIterator>
      basic_string& replace(iterator i1, iterator i2,
  			  InputIterator j1, InputIterator j2);
--- 255,261 ----
      { return replace (i1 - begin (), i2 - i1, s); }
    basic_string& replace (iterator i1, iterator i2, size_type n, charT c)
      { return replace (i1 - begin (), i2 - i1, n, c); }
! #ifdef __STL_MEMBER_TEMPLATES
    template<class InputIterator>
      basic_string& replace(iterator i1, iterator i2,
  			  InputIterator j1, InputIterator j2);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-09-26 19:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-25 16:45 string and member templates Joe Buck
1997-09-26  8:36 ` Oleg Krivosheev
1997-09-26 16:59   ` Joe Buck
1997-09-26 19:46   ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).