* 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
* Re: string and member templates
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
0 siblings, 2 replies; 4+ messages in thread
From: Oleg Krivosheev @ 1997-09-26 8:36 UTC (permalink / raw)
To: Joe Buck; +Cc: egcs team
Hi, Joe
On Thu, 25 Sep 1997, Joe Buck wrote:
> Date: Thu, 25 Sep 1997 16:44:56 -0700 (PDT)
> From: Joe Buck <jbuck@synopsys.com>
> To: egcs team <egcs@cygnus.com>
> Subject: string and member templates
>
> 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
>
just tried to build egcs with your patch
on Sun/Solaris Ultra box:
test -z "-fPIC" || \
/home/room1/kriol/egcs-970924/gcc/xgcc
-B/home/room1/kriol/egcs-970924/gcc/ -c -g -O2 -fno-implicit-templates -I.
-I./stl -I../libio -I./../libio -nostdinc++ -fPIC stdexcepti.cc -o
pic/stdexcepti.o
In file included from string:6,
from stdexcept:36,
from stdexcepti.cc:8:
std/bastring.h:156: type specifier omitted for parameter
std/bastring.h:156: parse error before `&'
std/bastring.h:156: invalid member template declaration
make[1]: *** [stdexcepti.o] Error 1
regards
OK
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: string and member templates
1997-09-26 8:36 ` Oleg Krivosheev
@ 1997-09-26 16:59 ` Joe Buck
1997-09-26 19:46 ` Jason Merrill
1 sibling, 0 replies; 4+ messages in thread
From: Joe Buck @ 1997-09-26 16:59 UTC (permalink / raw)
To: Oleg Krivosheev; +Cc: jbuck, egcs
I wrote:
> > 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
> >
>
> just tried to build egcs with your patch
> on Sun/Solaris Ultra box:
Forget the patch; a bit more work is required. Maybe I can provide
something in the future.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: string and member templates
1997-09-26 8:36 ` Oleg Krivosheev
1997-09-26 16:59 ` Joe Buck
@ 1997-09-26 19:46 ` Jason Merrill
1 sibling, 0 replies; 4+ messages in thread
From: Jason Merrill @ 1997-09-26 19:46 UTC (permalink / raw)
To: egcs
>>>>> Joe Buck <jbuck@synopsys.com> writes:
> Forget the patch; a bit more work is required. Maybe I can provide
> something in the future.
Don't bother; I whipped up an implementation for the next snapshot.
Jason
^ 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).