problem with strings in 970929
Kate Hedstrom
kate@ahab.Rutgers.EDU
Wed Oct 1 20:16:00 GMT 1997
I tried this program (from the new Stroustrup book) on a freebsd system
and it compiled with 970924:
#include <iostream.h>
#include <iterator.h>
#include <string>
ostream_iterator<string> oo(cout);
int main()
{
*oo = "Hello, ";
++oo;
*oo = "world!\n";
}
Now I get:
g++ --save-temps io1.cc
In file included from /usr/local/include/g++/std/bastring.h:40,
from /usr/local/include/g++/string:6,
from io1.cc:3:
/usr/local/include/g++/stdexcept:41: syntax error before `;'
/usr/local/include/g++/stdexcept:43: parse error before `&'
/usr/local/include/g++/stdexcept:43: missing ';' before right brace
/usr/local/include/g++/stdexcept:44: extraneous `char' ignored
:
:
The io1.ii file is:
# 1 "io1.cc"
# 1 "/usr/local/include/g++/iostream.h" 1 3
#pragma interface
# 1 "/usr/local/include/g++/streambuf.h" 1 3
#pragma interface
extern "C" {
# 1 "/usr/local/include/g++/libio.h" 1 3
# 1 "/usr/local/include/g++/_G_config.h" 1 3
typedef long _G_clock_t;
typedef short _G_dev_t;
typedef long _G_fpos_t;
typedef unsigned short _G_gid_t;
typedef unsigned long _G_ino_t;
typedef unsigned short _G_mode_t;
typedef short _G_nlink_t;
typedef long _G_off_t;
typedef int _G_pid_t;
typedef int _G_ptrdiff_t;
typedef int _G_sigset_t;
typedef long unsigned int _G_size_t;
typedef long _G_time_t;
typedef unsigned short _G_uid_t;
typedef short unsigned int _G_wchar_t;
typedef int _G_ssize_t;
typedef int _G_wint_t;
typedef char * _G_va_list;
typedef int _G_int8_t __attribute__((__mode__(__QI__)));
typedef unsigned int _G_uint8_t __attribute__((__mode__(__QI__)));
typedef int _G_int16_t __attribute__((__mode__(__HI__)));
typedef unsigned int _G_uint16_t __attribute__((__mode__(__HI__)));
typedef int _G_int32_t __attribute__((__mode__(__SI__)));
typedef unsigned int _G_uint32_t __attribute__((__mode__(__SI__)));
typedef int _G_int64_t __attribute__((__mode__(__DI__)));
typedef unsigned int _G_uint64_t __attribute__((__mode__(__DI__)));
# 30 "/usr/local/include/g++/libio.h" 2 3
# 51 "/usr/local/include/g++/libio.h" 3
# 1 "/usr/local/include/sys/cdefs.h" 1 3
# 98 "/usr/local/include/sys/cdefs.h" 3
# 55 "/usr/local/include/g++/libio.h" 2 3
struct _IO_jump_t; struct _IO_FILE;
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 182 "/usr/local/include/g++/libio.h" 3
};
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _blksize;
_G_off_t _offset;
unsigned short _cur_column;
char _unused;
char _shortbuf[1];
_IO_lock_t *_lock;
};
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
typedef struct
{
_G_ssize_t (*read) (struct _IO_FILE *, void *, _G_ssize_t ) ;
_G_ssize_t (*write) (struct _IO_FILE *, const void *, _G_ssize_t ) ;
_G_fpos_t (*seek) (struct _IO_FILE *, _G_off_t , int) ;
int (*close) (struct _IO_FILE *) ;
} _IO_cookie_io_functions_t;
struct _IO_cookie_file
{
struct _IO_FILE file;
const void *vtable;
void *cookie;
_IO_cookie_io_functions_t io_functions;
};
extern "C" {
extern int __underflow (_IO_FILE *) ;
extern int __uflow (_IO_FILE *) ;
extern int __overflow (_IO_FILE *, int) ;
extern int _IO_getc (_IO_FILE *__fp) ;
extern int _IO_putc (int __c, _IO_FILE *__fp) ;
extern int _IO_feof (_IO_FILE *__fp) ;
extern int _IO_ferror (_IO_FILE *__fp) ;
extern int _IO_peekc_locked (_IO_FILE *__fp) ;
extern void _IO_flockfile (_IO_FILE *) ;
extern void _IO_funlockfile (_IO_FILE *) ;
extern int _IO_ftrylockfile (_IO_FILE *) ;
extern int _IO_vfscanf (_IO_FILE *, const char *, _G_va_list , int *) ;
extern int _IO_vfprintf (_IO_FILE *, const char *, _G_va_list ) ;
extern _G_ssize_t _IO_padn (_IO_FILE *, int, _G_ssize_t ) ;
extern _G_size_t _IO_sgetn (_IO_FILE *, void *, _G_size_t ) ;
extern _G_fpos_t _IO_seekoff (_IO_FILE *, _G_off_t , int, int) ;
extern _G_fpos_t _IO_seekpos (_IO_FILE *, _G_fpos_t , int) ;
extern void _IO_free_backup_area (_IO_FILE *) ;
}
# 36 "/usr/local/include/g++/streambuf.h" 2 3
}
extern "C++" {
class istream;
class ostream; class streambuf;
typedef _G_off_t streamoff;
typedef _G_fpos_t streampos;
typedef _G_ssize_t streamsize;
typedef unsigned long __fmtflags;
typedef unsigned char __iostate;
struct _ios_fields
{
streambuf *_strbuf;
ostream* _tie;
int _width;
__fmtflags _flags;
short _fill;
__iostate _state;
__iostate _exceptions;
int _precision;
void *_arrays;
};
# 115 "/usr/local/include/g++/streambuf.h" 3
class ios : public _ios_fields {
ios& operator=(ios&);
ios (const ios&);
public:
typedef __fmtflags fmtflags;
typedef int iostate;
typedef int openmode;
typedef int streamsize;
enum io_state {
goodbit = 0 ,
eofbit = 1 ,
failbit = 2 ,
badbit = 4 };
enum open_mode {
in = 1 ,
out = 2 ,
ate = 4 ,
app = 8 ,
trunc = 16 ,
nocreate = 32 ,
noreplace = 64 ,
bin = 128 ,
binary = 128 };
enum seek_dir { beg, cur, end};
typedef enum seek_dir seekdir;
enum { skipws= 01 ,
left= 02 , right= 04 , internal= 010 ,
dec= 020 , oct= 040 , hex= 0100 ,
showbase= 0200 , showpoint= 0400 ,
uppercase= 01000 , showpos= 02000 ,
scientific= 04000 , fixed= 010000 ,
unitbuf= 020000 , stdio= 040000
};
enum {
basefield=dec+oct+hex,
floatfield = scientific+fixed,
adjustfield = left+right+internal
};
# 168 "/usr/local/include/g++/streambuf.h" 3
ostream* tie() const { return _tie; }
ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
short fill() const { return (short )_fill; }
short fill(short newf)
{short oldf = (short )_fill; _fill = (char)newf; return oldf;}
fmtflags flags() const { return _flags; }
fmtflags flags(fmtflags new_val) {
fmtflags old_val = _flags; _flags = new_val; return old_val; }
int precision() const { return _precision; }
int precision(int newp) {
unsigned short oldp = _precision; _precision = (unsigned short)newp;
return oldp; }
fmtflags setf(fmtflags val) {
fmtflags oldbits = _flags;
_flags |= val; return oldbits; }
fmtflags setf(fmtflags val, fmtflags mask) {
fmtflags oldbits = _flags;
_flags = (_flags & ~mask) | (val & mask); return oldbits; }
fmtflags unsetf(fmtflags mask) {
fmtflags oldbits = _flags;
_flags &= ~mask; return oldbits; }
int width() const { return _width; }
int width(int val) { int save = _width; _width = val; return save; }
void _throw_failure() const { }
void clear(iostate state = 0) {
_state = _strbuf ? state : state|badbit;
if (_state & _exceptions) _throw_failure(); }
void set(iostate flag) { _state |= flag;
if (_state & _exceptions) _throw_failure(); }
void setstate(iostate flag) { _state |= flag;
if (_state & _exceptions) _throw_failure(); }
int good() const { return _state == 0; }
int eof() const { return _state & ios::eofbit; }
int fail() const { return _state & (ios::badbit|ios::failbit); }
int bad() const { return _state & ios::badbit; }
iostate rdstate() const { return _state; }
operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
int operator!() const { return fail(); }
iostate exceptions() const { return _exceptions; }
void exceptions(iostate enable) {
_exceptions = enable;
if (_state & _exceptions) _throw_failure(); }
streambuf* rdbuf() const { return _strbuf; }
streambuf* rdbuf(streambuf *_s) {
streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }
static int sync_with_stdio(int on);
static void sync_with_stdio() { sync_with_stdio(1); }
static fmtflags bitalloc();
static int xalloc();
void*& pword(int);
void* pword(int) const;
long& iword(int);
long iword(int) const;
class Init {
public:
Init () { }
};
protected:
inline ios(streambuf* sb = 0, ostream* tie_to = 0);
inline virtual ~ios();
inline void init(streambuf* sb, ostream* tie = 0);
};
typedef ios::seek_dir _seek_dir;
class streammarker : private _IO_marker {
friend class streambuf;
void set_offset(int offset) { _pos = offset; }
public:
streammarker(streambuf *sb);
~streammarker();
int saving() { return 1; }
int delta(streammarker&);
int delta();
};
struct streambuf : public _IO_FILE {
friend class ios;
friend class istream;
friend class ostream;
friend class streammarker;
const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
protected:
static streambuf* _list_all;
_IO_FILE*& xchain() { return _chain; }
void _un_link();
void _link_in();
char* gptr() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; }
char* pptr() const { return _IO_write_ptr; }
char* egptr() const
{ return _flags & 0x100 ? _IO_save_end : _IO_read_end; }
char* epptr() const { return _IO_write_end; }
char* pbase() const { return _IO_write_base; }
char* eback() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_base;}
char* base() const { return _IO_buf_base; }
char* ebuf() const { return _IO_buf_end; }
int blen() const { return _IO_buf_end - _IO_buf_base; }
void xput_char(char c) { *_IO_write_ptr++ = c; }
int xflags() { return _flags ; }
int xflags(int f) {int fl = _flags ; _flags = f; return fl;}
void xsetflags(int f) { _flags |= f; }
void xsetflags(int f, int mask)
{ _flags = (_flags & ~mask) | (f & mask); }
void gbump(int n)
{ _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
void pbump(int n) { _IO_write_ptr += n; }
void setb(char* b, char* eb, int a=0);
void setp(char* p, char* ep)
{ _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
void setg(char* eb, char* g, char *eg) {
if (_flags & 0x100 ) _IO_free_backup_area(this);
_IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
char *shortbuf() { return _shortbuf; }
int in_backup() { return _flags & 0x100 ; }
char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
char *Bptr() { return _IO_backup_base; }
char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
char *Nbase() { return _IO_save_base; }
char *eNptr() { return _IO_save_end; }
int have_backup() { return _IO_save_base != (__null) ; }
int have_markers() { return _markers != (__null) ; }
void free_backup_area();
void unsave_markers();
int put_mode() { return _flags & 0x800 ; }
int switch_to_get_mode();
streambuf(int flags=0);
public:
static int flush_all();
static void flush_all_linebuffered();
virtual ~streambuf();
virtual int overflow(int c = (-1) );
virtual int underflow();
virtual int uflow();
virtual int pbackfail(int c);
virtual streamsize xsputn(const char* s, streamsize n);
virtual streamsize xsgetn(char* s, streamsize n);
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out)
{ return _IO_seekoff (this, o, d, mode); }
streampos pubseekpos(streampos pos, int mode = ios::in|ios::out)
{ return _IO_seekpos (this, pos, mode); }
streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
virtual int sync();
virtual int doallocate();
int seekmark(streammarker& mark, int delta = 0);
int sputbackc(char c);
int sungetc();
int unbuffered() { return _flags & 2 ? 1 : 0; }
int linebuffered() { return _flags & 0x200 ? 1 : 0; }
void unbuffered(int i)
{ if (i) _flags |= 2 ; else _flags &= ~2 ; }
void linebuffered(int i)
{ if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; }
int allocate() {
if (base() || unbuffered()) return 0;
else return doallocate(); }
void allocbuf() { if (base() == (__null) ) doallocbuf(); }
void doallocbuf();
int in_avail() { return _IO_read_end - _IO_read_ptr; }
int out_waiting() { return _IO_write_ptr - _IO_write_base; }
streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
int ignore(int);
int get_column();
int set_column(int);
long sgetline(char* buf, _G_size_t n, char delim, int putback_delim);
int sputc(int c) { return _IO_putc(c, this); }
int sbumpc() { return _IO_getc(this); }
int sgetc() { return _IO_peekc_locked ( this ) ; }
int snextc() {
if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) )
return (-1) ;
else return _IO_read_ptr++, sgetc(); }
void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
int vscan(char const *fmt0, _G_va_list ap, ios* stream = (__null) );
int scan(char const *fmt0 ...);
int vform(char const *fmt0, _G_va_list ap);
int form(char const *fmt0 ...);
virtual streamsize sys_read(char* buf, streamsize size);
virtual streamsize sys_write(const char*, streamsize);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual int sys_close();
virtual int sys_stat(void*);
};
class filebuf : public streambuf {
protected:
void init();
public:
static const int openprot;
filebuf();
filebuf(int fd);
filebuf(int fd, char* p, int len);
~filebuf();
filebuf* attach(int fd);
filebuf* open(const char *filename, const char *mode);
filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
virtual int underflow();
virtual int overflow(int c = (-1) );
int is_open() const { return _fileno >= 0; }
int fd() const { return is_open() ? _fileno : (-1) ; }
filebuf* close();
virtual int doallocate();
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
streamsize xsputn(const char* s, streamsize n);
streamsize xsgetn(char* s, streamsize n);
virtual int sync();
protected:
int is_reading() { return eback() != egptr(); }
char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
char* file_ptr() { return eGptr(); }
virtual streamsize sys_read(char* buf, streamsize size);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual streamsize sys_write(const char*, streamsize);
virtual int sys_stat(void*);
virtual int sys_close();
};
inline void ios::init(streambuf* sb, ostream* tie_to) {
_state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
_strbuf=sb; _tie = tie_to; _width=0; _fill=' ';
_flags=ios::skipws|ios::dec;
_precision=6; _arrays = 0; }
inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }
inline ios::~ios() {
if (_arrays) delete [] _arrays;
}
}
# 31 "/usr/local/include/g++/iostream.h" 2 3
extern "C++" {
class istream; class ostream;
typedef ios& (*__manip)(ios&);
typedef istream& (*__imanip)(istream&);
typedef ostream& (*__omanip)(ostream&);
extern istream& ws(istream& ins);
extern ostream& flush(ostream& outs);
extern ostream& endl(ostream& outs);
extern ostream& ends(ostream& outs);
class ostream : virtual public ios
{
void do_osfx();
public:
ostream() { }
ostream(streambuf* sb, ostream* tied= (__null) );
int opfx() {
if (!good()) return 0;
else { if (_tie) _tie->flush(); ; return 1;} }
void osfx() { ;
if (flags() & (ios::unitbuf|ios::stdio))
do_osfx(); }
ostream& flush();
ostream& put(char c) { _strbuf->sputc(c); return *this; }
ostream& write(const char *s, streamsize n);
ostream& write(const unsigned char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const signed char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const void *s, streamsize n)
{ return write((const char*)s, n);}
ostream& seekp(streampos);
ostream& seekp(streamoff, _seek_dir);
streampos tellp();
ostream& form(const char *format ...);
ostream& vform(const char *format, _G_va_list args);
ostream& operator<<(char c);
ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
ostream& operator<<(signed char c) { return (*this) << (char)c; }
ostream& operator<<(const char *s);
ostream& operator<<(const unsigned char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const signed char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const void *p);
ostream& operator<<(int n);
ostream& operator<<(unsigned int n);
ostream& operator<<(long n);
ostream& operator<<(unsigned long n);
__extension__ ostream& operator<<(long long n);
__extension__ ostream& operator<<(unsigned long long n);
ostream& operator<<(short n) {return operator<<((int)n);}
ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}
ostream& operator<<(bool b) { return operator<<((int)b); }
ostream& operator<<(double n);
ostream& operator<<(float n) { return operator<<((double)n); }
ostream& operator<<(long double n) { return operator<<((double)n); }
ostream& operator<<(__omanip func) { return (*func)(*this); }
ostream& operator<<(__manip func) {(*func)(*this); return *this;}
ostream& operator<<(streambuf*);
};
class istream : virtual public ios
{
protected:
_G_size_t _gcount;
int _skip_ws();
public:
istream(): _gcount (0) { }
istream(streambuf* sb, ostream*tied= (__null) );
istream& get(char* ptr, int len, char delim = '\n');
istream& get(unsigned char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& get(char& c);
istream& get(unsigned char& c) { return get((char&)c); }
istream& getline(char* ptr, int len, char delim = '\n');
istream& getline(unsigned char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& get(signed char& c) { return get((char&)c); }
istream& get(signed char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& getline(signed char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& read(char *ptr, streamsize n);
istream& read(unsigned char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(signed char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(void *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& get(streambuf& sb, char delim = '\n');
istream& gets(char **s, char delim = '\n');
int ipfx(int need = 0) {
if (!good()) { set(ios::failbit); return 0; }
else {
;
if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
if (!need && (flags() & ios::skipws)) return _skip_ws();
else return 1;
}
}
int ipfx0() {
if (!good()) { set(ios::failbit); return 0; }
else {
;
if (_tie) _tie->flush();
if (flags() & ios::skipws) return _skip_ws();
else return 1;
}
}
int ipfx1() {
if (!good()) { set(ios::failbit); return 0; }
else {
;
if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
return 1;
}
}
void isfx() { ; }
int get() { if (!ipfx1()) return (-1) ;
else { int ch = _strbuf->sbumpc();
if (ch == (-1) ) set(ios::eofbit);
return ch;
} }
int peek();
_G_size_t gcount() { return _gcount; }
istream& ignore(int n=1, int delim = (-1) );
int sync ();
istream& seekg(streampos);
istream& seekg(streamoff, _seek_dir);
streampos tellg();
istream& putback(char ch) {
if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
return *this;}
istream& unget() {
if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
return *this;}
istream& scan(const char *format ...);
istream& vscan(const char *format, _G_va_list args);
istream& operator>>(char*);
istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
istream& operator>>(signed char*p) { return operator>>((char*)p); }
istream& operator>>(char& c);
istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
istream& operator>>(signed char& c) {return operator>>((char&)c);}
istream& operator>>(int&);
istream& operator>>(long&);
__extension__ istream& operator>>(long long&);
__extension__ istream& operator>>(unsigned long long&);
istream& operator>>(short&);
istream& operator>>(unsigned int&);
istream& operator>>(unsigned long&);
istream& operator>>(unsigned short&);
istream& operator>>(bool&);
istream& operator>>(float&);
istream& operator>>(double&);
istream& operator>>(long double&);
istream& operator>>( __manip func) {(*func)(*this); return *this;}
istream& operator>>(__imanip func) { return (*func)(*this); }
istream& operator>>(streambuf*);
};
class iostream : public istream, public ostream
{
public:
iostream() { }
iostream(streambuf* sb, ostream*tied= (__null) );
};
class _IO_istream_withassign : public istream {
public:
_IO_istream_withassign& operator=(istream&);
_IO_istream_withassign& operator=(_IO_istream_withassign& rhs)
{ return operator= (static_cast<istream&> (rhs)); }
};
class _IO_ostream_withassign : public ostream {
public:
_IO_ostream_withassign& operator=(ostream&);
_IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs)
{ return operator= (static_cast<ostream&> (rhs)); }
};
extern _IO_istream_withassign cin;
extern _IO_ostream_withassign cout, cerr;
extern _IO_ostream_withassign clog
;
extern istream& lock(istream& ins);
extern istream& unlock(istream& ins);
extern ostream& lock(ostream& outs);
extern ostream& unlock(ostream& outs);
struct Iostream_init { } ;
inline ios& dec(ios& i)
{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
inline ios& hex(ios& i)
{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
inline ios& oct(ios& i)
{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
}
# 1 "io1.cc" 2
# 1 "/usr/local/include/g++/iterator.h" 1 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/stddef.h" 1 3 4
# 61 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/stddef.h" 3 4
typedef int ptrdiff_t;
typedef long unsigned int size_t;
typedef unsigned int wint_t;
# 302 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/stddef.h" 3 4
# 30 "/usr/local/include/g++/iterator.h" 2 3
# 1 "/usr/local/include/g++/function.h" 1 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/stddef.h" 1 3 4
# 327 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/stddef.h" 3 4
# 30 "/usr/local/include/g++/function.h" 2 3
# 1 "/usr/local/include/g++/stl_config.h" 1 3
# 84 "/usr/local/include/g++/stl_config.h" 3
# 132 "/usr/local/include/g++/stl_config.h" 3
# 146 "/usr/local/include/g++/stl_config.h" 3
# 31 "/usr/local/include/g++/function.h" 2 3
template <class T>
inline bool operator!=(const T& x, const T& y) {
return !(x == y);
}
template <class T>
inline bool operator>(const T& x, const T& y) {
return y < x;
}
template <class T>
inline bool operator<=(const T& x, const T& y) {
return !(y < x);
}
template <class T>
inline bool operator>=(const T& x, const T& y) {
return !(x < y);
}
template <class Arg, class Result>
struct unary_function {
typedef Arg argument_type;
typedef Result result_type;
};
template <class Arg1, class Arg2, class Result>
struct binary_function {
typedef Arg1 first_argument_type;
typedef Arg2 second_argument_type;
typedef Result result_type;
};
template <class T>
struct plus : public binary_function<T, T, T> {
T operator()(const T& x, const T& y) const { return x + y; }
};
template <class T>
struct minus : public binary_function<T, T, T> {
T operator()(const T& x, const T& y) const { return x - y; }
};
template <class T>
struct multiplies : public binary_function<T, T, T> {
T operator()(const T& x, const T& y) const { return x * y; }
};
template <class T>
struct divides : public binary_function<T, T, T> {
T operator()(const T& x, const T& y) const { return x / y; }
};
template <class T> inline T identity_element(plus<T>) { return T(0); }
template <class T> inline T identity_element(multiplies<T>) { return T(1); }
template <class T>
struct modulus : public binary_function<T, T, T> {
T operator()(const T& x, const T& y) const { return x % y; }
};
template <class T>
struct negate : public unary_function<T, T> {
T operator()(const T& x) const { return -x; }
};
template <class T>
struct equal_to : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x == y; }
};
template <class T>
struct not_equal_to : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x != y; }
};
template <class T>
struct greater : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x > y; }
};
template <class T>
struct less : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x < y; }
};
template <class T>
struct greater_equal : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x >= y; }
};
template <class T>
struct less_equal : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x <= y; }
};
template <class T>
struct logical_and : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x && y; }
};
template <class T>
struct logical_or : public binary_function<T, T, bool> {
bool operator()(const T& x, const T& y) const { return x || y; }
};
template <class T>
struct logical_not : public unary_function<T, bool> {
bool operator()(const T& x) const { return !x; }
};
template <class Predicate>
class unary_negate
: public unary_function<typename Predicate::argument_type, bool> {
protected:
Predicate pred;
public:
explicit unary_negate(const Predicate& x) : pred(x) {}
bool operator()(const argument_type& x) const { return !pred(x); }
};
template <class Predicate>
inline unary_negate<Predicate> not1(const Predicate& pred) {
return unary_negate<Predicate>(pred);
}
template <class Predicate>
class binary_negate
: public binary_function<typename Predicate::first_argument_type,
typename Predicate::second_argument_type,
bool> {
protected:
Predicate pred;
public:
explicit binary_negate(const Predicate& x) : pred(x) {}
bool operator()(const first_argument_type& x,
const second_argument_type& y) const {
return !pred(x, y);
}
};
template <class Predicate>
inline binary_negate<Predicate> not2(const Predicate& pred) {
return binary_negate<Predicate>(pred);
}
template <class Operation>
class binder1st
: public unary_function<typename Operation::second_argument_type,
typename Operation::result_type> {
protected:
Operation op;
typename Operation::first_argument_type value;
public:
binder1st(const Operation& x,
const typename Operation::first_argument_type& y)
: op(x), value(y) {}
result_type operator()(const argument_type& x) const {
return op(value, x);
}
};
template <class Operation, class T>
inline binder1st<Operation> bind1st(const Operation& op, const T& x) {
typedef typename Operation::first_argument_type arg1_type;
return binder1st<Operation>(op, arg1_type(x));
}
template <class Operation>
class binder2nd
: public unary_function<typename Operation::first_argument_type,
typename Operation::result_type> {
protected:
Operation op;
typename Operation::second_argument_type value;
public:
binder2nd(const Operation& x,
const typename Operation::second_argument_type& y)
: op(x), value(y) {}
result_type operator()(const argument_type& x) const {
return op(x, value);
}
};
template <class Operation, class T>
inline binder2nd<Operation> bind2nd(const Operation& op, const T& x) {
typedef typename Operation::second_argument_type arg2_type;
return binder2nd<Operation>(op, arg2_type(x));
}
template <class Operation1, class Operation2>
class unary_compose : public unary_function<typename Operation2::argument_type,
typename Operation1::result_type> {
protected:
Operation1 op1;
Operation2 op2;
public:
unary_compose(const Operation1& x, const Operation2& y) : op1(x), op2(y) {}
result_type operator()(const argument_type& x) const {
return op1(op2(x));
}
};
template <class Operation1, class Operation2>
inline unary_compose<Operation1, Operation2> compose1(const Operation1& op1,
const Operation2& op2) {
return unary_compose<Operation1, Operation2>(op1, op2);
}
template <class Operation1, class Operation2, class Operation3>
class binary_compose
: public unary_function<typename Operation2::argument_type,
typename Operation1::result_type> {
protected:
Operation1 op1;
Operation2 op2;
Operation3 op3;
public:
binary_compose(const Operation1& x, const Operation2& y,
const Operation3& z) : op1(x), op2(y), op3(z) { }
result_type operator()(const argument_type& x) const {
return op1(op2(x), op3(x));
}
};
template <class Operation1, class Operation2, class Operation3>
inline binary_compose<Operation1, Operation2, Operation3>
compose2(const Operation1& op1, const Operation2& op2, const Operation3& op3) {
return binary_compose<Operation1, Operation2, Operation3>(op1, op2, op3);
}
template <class Arg, class Result>
class pointer_to_unary_function : public unary_function<Arg, Result> {
protected:
Result (*ptr)(Arg);
public:
pointer_to_unary_function() {}
explicit pointer_to_unary_function(Result (*x)(Arg)) : ptr(x) {}
Result operator()(Arg x) const { return ptr(x); }
};
template <class Arg, class Result>
inline pointer_to_unary_function<Arg, Result> ptr_fun(Result (*x)(Arg)) {
return pointer_to_unary_function<Arg, Result>(x);
}
template <class Arg1, class Arg2, class Result>
class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result> {
protected:
Result (*ptr)(Arg1, Arg2);
public:
pointer_to_binary_function() {}
explicit pointer_to_binary_function(Result (*x)(Arg1, Arg2)) : ptr(x) {}
Result operator()(Arg1 x, Arg2 y) const { return ptr(x, y); }
};
template <class Arg1, class Arg2, class Result>
inline pointer_to_binary_function<Arg1, Arg2, Result>
ptr_fun(Result (*x)(Arg1, Arg2)) {
return pointer_to_binary_function<Arg1, Arg2, Result>(x);
}
template <class T>
struct identity : public unary_function<T, T> {
const T& operator()(const T& x) const { return x; }
};
template <class Pair>
struct select1st : public unary_function<Pair, typename Pair::first_type> {
const typename Pair::first_type& operator()(const Pair& x) const
{
return x.first;
}
};
template <class Pair>
struct select2nd : public unary_function<Pair, typename Pair::second_type> {
const typename Pair::second_type& operator()(const Pair& x) const
{
return x.second;
}
};
template <class Arg1, class Arg2>
struct project1st : public binary_function<Arg1, Arg2, Arg1> {
Arg1 operator()(const Arg1& x, const Arg2&) const { return x; }
};
template <class Arg1, class Arg2>
struct project2nd : public binary_function<Arg1, Arg2, Arg2> {
Arg2 operator()(const Arg1&, const Arg2& y) const { return y; }
};
template <class Result>
struct constant_void_fun
{
typedef Result result_type;
result_type val;
constant_void_fun(const result_type& v) : val(v) {}
const result_type& operator()() const { return val; }
};
template <class Result, class Argument = Result>
struct constant_unary_fun : public unary_function<Argument, Result> {
result_type val;
constant_unary_fun(const result_type& v) : val(v) {}
const result_type& operator()(const argument_type&) const { return val; }
};
template <class Result, class Arg1 = Result, class Arg2 = Arg1>
struct constant_binary_fun : public binary_function<Arg1, Arg2, Result> {
result_type val;
constant_binary_fun(const result_type& v) : val(v) {}
const result_type& operator()(const first_argument_type&,
const second_argument_type&) const {
return val;
}
};
template <class Result>
inline constant_void_fun<Result> constant0(const Result& val)
{
return constant_void_fun<Result>(val);
}
template <class Result>
inline constant_unary_fun<Result,Result> constant1(const Result& val)
{
return constant_unary_fun<Result,Result>(val);
}
template <class Result>
inline constant_binary_fun<Result,Result,Result> constant2(const Result& val)
{
return constant_binary_fun<Result,Result,Result>(val);
}
class subtractive_rng : public unary_function<unsigned int, unsigned int> {
private:
unsigned int table[55];
size_t index1;
size_t index2;
public:
unsigned int operator()(unsigned int limit) {
index1 = (index1 + 1) % 55;
index2 = (index2 + 1) % 55;
table[index1] = table[index1] - table[index2];
return table[index1] % limit;
}
void initialize(unsigned int seed)
{
unsigned int k = 1;
table[54] = seed;
size_t i;
for (i = 0; i < 54; i++) {
size_t ii = (21 * (i + 1) % 55) - 1;
table[ii] = k;
k = seed - k;
seed = table[ii];
}
for (int loop = 0; loop < 4; loop++) {
for (i = 0; i < 55; i++)
table[i] = table[i] - table[(1 + i + 30) % 55];
}
index1 = 0;
index2 = 31;
}
subtractive_rng(unsigned int seed) { initialize(seed); }
subtractive_rng() { initialize(161803398u); }
};
template <class S, class T>
class mem_fun_t : public unary_function<T*, S> {
public:
explicit mem_fun_t(S (T::*pf)()) : f(pf) {}
S operator()(T* p) const { return (p->*f)(); }
private:
S (T::*f)();
};
template <class S, class T>
class const_mem_fun_t : public unary_function<const T*, S> {
public:
explicit const_mem_fun_t(S (T::*pf)() const) : f(pf) {}
S operator()(const T* p) const { return (p->*f)(); }
private:
S (T::*f)() const;
};
template <class S, class T>
class mem_fun_ref_t : public unary_function<T, S> {
public:
explicit mem_fun_ref_t(S (T::*pf)()) : f(pf) {}
S operator()(T& r) const { return (r.*f)(); }
private:
S (T::*f)();
};
template <class S, class T>
class const_mem_fun_ref_t : public unary_function<T, S> {
public:
explicit const_mem_fun_ref_t(S (T::*pf)() const) : f(pf) {}
S operator()(const T& r) const { return (r.*f)(); }
private:
S (T::*f)() const;
};
template <class S, class T, class A>
class mem_fun1_t : public binary_function<T*, A, S> {
public:
explicit mem_fun1_t(S (T::*pf)(A)) : f(pf) {}
S operator()(T* p, A x) const { return (p->*f)(x); }
private:
S (T::*f)(A);
};
template <class S, class T, class A>
class const_mem_fun1_t : public binary_function<const T*, A, S> {
public:
explicit const_mem_fun1_t(S (T::*pf)(A) const) : f(pf) {}
S operator()(const T* p, A x) const { return (p->*f)(x); }
private:
S (T::*f)(A) const;
};
template <class S, class T, class A>
class mem_fun1_ref_t : public binary_function<T, A, S> {
public:
explicit mem_fun1_ref_t(S (T::*pf)(A)) : f(pf) {}
S operator()(T& r, A x) const { return (r.*f)(x); }
private:
S (T::*f)(A);
};
template <class S, class T, class A>
class const_mem_fun1_ref_t : public binary_function<T, A, S> {
public:
explicit const_mem_fun1_ref_t(S (T::*pf)(A) const) : f(pf) {}
S operator()(const T& r, A x) const { return (r.*f)(x); }
private:
S (T::*f)(A) const;
};
template <class T>
class mem_fun_t<void, T> : public unary_function<T*, void> {
public:
explicit mem_fun_t(void (T::*pf)()) : f(pf) {}
void operator()(T* p) const { (p->*f)(); }
private:
void (T::*f)();
};
template <class T>
class const_mem_fun_t<void, T> : public unary_function<const T*, void> {
public:
explicit const_mem_fun_t(void (T::*pf)() const) : f(pf) {}
void operator()(const T* p) const { (p->*f)(); }
private:
void (T::*f)() const;
};
template <class T>
class mem_fun_ref_t<void, T> : public unary_function<T, void> {
public:
explicit mem_fun_ref_t(void (T::*pf)()) : f(pf) {}
void operator()(T& r) const { (r.*f)(); }
private:
void (T::*f)();
};
template <class T>
class const_mem_fun_ref_t<void, T> : public unary_function<T, void> {
public:
explicit const_mem_fun_ref_t(void (T::*pf)() const) : f(pf) {}
void operator()(const T& r) const { (r.*f)(); }
private:
void (T::*f)() const;
};
template <class T, class A>
class mem_fun1_t<void, T, A> : public binary_function<T*, A, void> {
public:
explicit mem_fun1_t(void (T::*pf)(A)) : f(pf) {}
void operator()(T* p, A x) const { (p->*f)(x); }
private:
void (T::*f)(A);
};
template <class T, class A>
class const_mem_fun1_t<void, T, A> : public binary_function<const T*, A, void> {
public:
explicit const_mem_fun1_t(void (T::*pf)(A) const) : f(pf) {}
void operator()(const T* p, A x) const { (p->*f)(x); }
private:
void (T::*f)(A) const;
};
template <class T, class A>
class mem_fun1_ref_t<void, T, A> : public binary_function<T, A, void> {
public:
explicit mem_fun1_ref_t(void (T::*pf)(A)) : f(pf) {}
void operator()(T& r, A x) const { (r.*f)(x); }
private:
void (T::*f)(A);
};
template <class T, class A>
class const_mem_fun1_ref_t<void, T, A> : public binary_function<T, A, void> {
public:
explicit const_mem_fun1_ref_t(void (T::*pf)(A) const) : f(pf) {}
void operator()(const T& r, A x) const { (r.*f)(x); }
private:
void (T::*f)(A) const;
};
template <class S, class T>
inline mem_fun_t<S,T> mem_fun(S (T::*f)()) {
return mem_fun_t<S,T>(f);
}
template <class S, class T>
inline const_mem_fun_t<S,T> mem_fun(S (T::*f)() const) {
return const_mem_fun_t<S,T>(f);
}
template <class S, class T>
inline mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()) {
return mem_fun_ref_t<S,T>(f);
}
template <class S, class T>
inline const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const) {
return const_mem_fun_ref_t<S,T>(f);
}
template <class S, class T, class A>
inline mem_fun1_t<S,T,A> mem_fun1(S (T::*f)(A)) {
return mem_fun1_t<S,T,A>(f);
}
template <class S, class T, class A>
inline const_mem_fun1_t<S,T,A> mem_fun1(S (T::*f)(A) const) {
return const_mem_fun1_t<S,T,A>(f);
}
template <class S, class T, class A>
inline mem_fun1_ref_t<S,T,A> mem_fun1_ref(S (T::*f)(A)) {
return mem_fun1_ref_t<S,T,A>(f);
}
template <class S, class T, class A>
inline const_mem_fun1_ref_t<S,T,A> mem_fun1_ref(S (T::*f)(A) const) {
return const_mem_fun1_ref_t<S,T,A>(f);
}
# 32 "/usr/local/include/g++/iterator.h" 2 3
struct input_iterator_tag {};
struct output_iterator_tag {};
struct forward_iterator_tag : public input_iterator_tag {};
struct bidirectional_iterator_tag : public forward_iterator_tag {};
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
template <class T, class Distance> struct input_iterator {
typedef input_iterator_tag iterator_category;
typedef T value_type;
typedef Distance difference_type;
typedef T* pointer;
typedef T& reference;
};
struct output_iterator {
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
};
template <class T, class Distance> struct forward_iterator {
typedef forward_iterator_tag iterator_category;
typedef T value_type;
typedef Distance difference_type;
typedef T* pointer;
typedef T& reference;
};
template <class T, class Distance> struct bidirectional_iterator {
typedef bidirectional_iterator_tag iterator_category;
typedef T value_type;
typedef Distance difference_type;
typedef T* pointer;
typedef T& reference;
};
template <class T, class Distance> struct random_access_iterator {
typedef random_access_iterator_tag iterator_category;
typedef T value_type;
typedef Distance difference_type;
typedef T* pointer;
typedef T& reference;
};
# 91 "/usr/local/include/g++/iterator.h" 3
template <class Iterator>
struct iterator_traits {
typedef typename Iterator::iterator_category iterator_category;
typedef typename Iterator::value_type value_type;
typedef typename Iterator::difference_type difference_type;
typedef typename Iterator::pointer pointer;
typedef typename Iterator::reference reference;
};
template <class T>
struct iterator_traits<T*> {
typedef random_access_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
};
template <class T>
struct iterator_traits<const T*> {
typedef random_access_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef const T* pointer;
typedef const T& reference;
};
template <class Iterator>
inline iterator_traits<Iterator>::iterator_category
iterator_category(const Iterator&) {
return iterator_traits<Iterator>::iterator_category();
}
template <class Iterator>
inline iterator_traits<Iterator>::difference_type*
distance_type(const Iterator&) {
return static_cast<iterator_traits<Iterator>::difference_type*>(0);
}
template <class Iterator>
inline iterator_traits<Iterator>::value_type*
value_type(const Iterator&) {
return static_cast<iterator_traits<Iterator>::value_type*>(0);
}
# 223 "/usr/local/include/g++/iterator.h" 3
template <class Container>
class back_insert_iterator {
protected:
Container* container;
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
explicit back_insert_iterator(Container& x) : container(&x) {}
back_insert_iterator<Container>&
operator=(const typename Container::value_type& value) {
container->push_back(value);
return *this;
}
back_insert_iterator<Container>& operator*() { return *this; }
back_insert_iterator<Container>& operator++() { return *this; }
back_insert_iterator<Container>& operator++(int) { return *this; }
};
# 256 "/usr/local/include/g++/iterator.h" 3
template <class Container>
inline back_insert_iterator<Container> back_inserter(Container& x) {
return back_insert_iterator<Container>(x);
}
template <class Container>
class front_insert_iterator {
protected:
Container* container;
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
explicit front_insert_iterator(Container& x) : container(&x) {}
front_insert_iterator<Container>&
operator=(const typename Container::value_type& value) {
container->push_front(value);
return *this;
}
front_insert_iterator<Container>& operator*() { return *this; }
front_insert_iterator<Container>& operator++() { return *this; }
front_insert_iterator<Container>& operator++(int) { return *this; }
};
# 294 "/usr/local/include/g++/iterator.h" 3
template <class Container>
inline front_insert_iterator<Container> front_inserter(Container& x) {
return front_insert_iterator<Container>(x);
}
template <class Container>
class insert_iterator {
protected:
Container* container;
typename Container::iterator iter;
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(Container& x, typename Container::iterator i)
: container(&x), iter(i) {}
insert_iterator<Container>&
operator=(const typename Container::value_type& value) {
iter = container->insert(iter, value);
++iter;
return *this;
}
insert_iterator<Container>& operator*() { return *this; }
insert_iterator<Container>& operator++() { return *this; }
insert_iterator<Container>& operator++(int) { return *this; }
};
# 335 "/usr/local/include/g++/iterator.h" 3
template <class Container, class Iterator>
inline insert_iterator<Container> inserter(Container& x, Iterator i) {
typedef typename Container::iterator iter;
return insert_iterator<Container>(x, iter(i));
}
template <class BidirectionalIterator, class T, class Reference = T&,
class Distance = ptrdiff_t>
class reverse_bidirectional_iterator {
typedef reverse_bidirectional_iterator<BidirectionalIterator, T, Reference,
Distance> self;
friend bool operator==(const self& x, const self& y);
protected:
BidirectionalIterator current;
public:
typedef bidirectional_iterator_tag iterator_category;
typedef T value_type;
typedef Distance difference_type;
typedef T* pointer;
typedef Reference reference;
reverse_bidirectional_iterator() {}
explicit reverse_bidirectional_iterator(BidirectionalIterator x)
: current(x) {}
BidirectionalIterator base() { return current; }
Reference operator*() const {
BidirectionalIterator tmp = current;
return *--tmp;
}
pointer operator->() const { return &(operator*()); }
self& operator++() {
--current;
return *this;
}
self operator++(int) {
self tmp = *this;
--current;
return tmp;
}
self& operator--() {
++current;
return *this;
}
self operator--(int) {
self tmp = *this;
++current;
return tmp;
}
};
# 421 "/usr/local/include/g++/iterator.h" 3
template <class BidirectionalIterator, class T, class Reference,
class Distance>
inline bool operator==(
const reverse_bidirectional_iterator<BidirectionalIterator, T, Reference,
Distance>& x,
const reverse_bidirectional_iterator<BidirectionalIterator, T, Reference,
Distance>& y) {
return x.current == y.current;
}
template <class Iterator>
class reverse_iterator : public iterator_traits<Iterator>
{
protected:
Iterator current;
public:
typedef Iterator iterator_type;
typedef reverse_iterator<Iterator> self;
public:
reverse_iterator() {}
explicit reverse_iterator(iterator_type x) : current(x) {}
reverse_iterator(const self& x) : current(x.current) {}
template <class Iter>
reverse_iterator(const reverse_iterator<Iter>& x) : current(x.current) {}
iterator_type base() const { return current; }
reference operator*() const {
Iterator tmp = current;
return *--tmp;
}
pointer operator->() const { return &(operator*()); }
self& operator++() {
--current;
return *this;
}
self operator++(int) {
self tmp = *this;
--current;
return tmp;
}
self& operator--() {
++current;
return *this;
}
self operator--(int) {
self tmp = *this;
++current;
return tmp;
}
self operator+(difference_type n) const {
return self(current - n);
}
self& operator+=(difference_type n) {
current -= n;
return *this;
}
self operator-(difference_type n) const {
return self(current + n);
}
self& operator-=(difference_type n) {
current += n;
return *this;
}
reference operator[](difference_type n) { return *(*this + n); }
};
template <class Iterator>
inline bool operator==(const reverse_iterator<Iterator>& x,
const reverse_iterator<Iterator>& y) {
return x.base() == y.base();
}
template <class Iterator>
inline bool operator<(const reverse_iterator<Iterator>& x,
const reverse_iterator<Iterator>& y) {
return y.base() < x.base();
}
template <class Iterator>
inline reverse_iterator<Iterator>::difference_type
operator-(const reverse_iterator<Iterator>& x,
const reverse_iterator<Iterator>& y) {
return y.base() - x.base();
}
template <class Iterator>
inline reverse_iterator<Iterator>
operator+(reverse_iterator<Iterator>::difference_type n,
const reverse_iterator<Iterator>& x) {
return reverse_iterator<Iterator>(x.base() - n);
}
# 654 "/usr/local/include/g++/iterator.h" 3
template <class ForwardIterator, class T>
class raw_storage_iterator {
protected:
ForwardIterator iter;
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
explicit raw_storage_iterator(ForwardIterator x) : iter(x) {}
raw_storage_iterator<ForwardIterator, T>& operator*() { return *this; }
raw_storage_iterator<ForwardIterator, T>& operator=(const T& element) {
construct(&*iter, element);
return *this;
}
raw_storage_iterator<ForwardIterator, T>& operator++() {
++iter;
return *this;
}
raw_storage_iterator<ForwardIterator, T> operator++(int) {
raw_storage_iterator<ForwardIterator, T> tmp = *this;
++iter;
return tmp;
}
};
# 693 "/usr/local/include/g++/iterator.h" 3
template <class T, class Distance = ptrdiff_t>
class istream_iterator {
friend bool operator==(const istream_iterator<T, Distance>& x,
const istream_iterator<T, Distance>& y);
protected:
istream* stream;
T value;
bool end_marker;
void read() {
end_marker = (*stream) ? true : false;
if (end_marker) *stream >> value;
end_marker = (*stream) ? true : false;
}
public:
typedef input_iterator_tag iterator_category;
typedef T value_type;
typedef Distance difference_type;
typedef const T* pointer;
typedef const T& reference;
istream_iterator() : stream(&cin), end_marker(false) {}
istream_iterator(istream& s) : stream(&s) { read(); }
reference operator*() const { return value; }
pointer operator->() const { return &(operator*()); }
istream_iterator<T, Distance>& operator++() {
read();
return *this;
}
istream_iterator<T, Distance> operator++(int) {
istream_iterator<T, Distance> tmp = *this;
read();
return tmp;
}
};
# 748 "/usr/local/include/g++/iterator.h" 3
template <class T, class Distance>
bool operator==(const istream_iterator<T, Distance>& x,
const istream_iterator<T, Distance>& y) {
return x.stream == y.stream && x.end_marker == y.end_marker ||
x.end_marker == false && y.end_marker == false;
}
template <class T>
class ostream_iterator {
protected:
ostream* stream;
const char* string;
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
ostream_iterator(ostream& s) : stream(&s), string(0) {}
ostream_iterator(ostream& s, const char* c) : stream(&s), string(c) {}
ostream_iterator<T>& operator=(const T& value) {
*stream << value;
if (string) *stream << string;
return *this;
}
ostream_iterator<T>& operator*() { return *this; }
ostream_iterator<T>& operator++() { return *this; }
ostream_iterator<T>& operator++(int) { return *this; }
};
# 789 "/usr/local/include/g++/iterator.h" 3
# 2 "io1.cc" 2
# 1 "/usr/local/include/g++/string" 1 3
# 1 "/usr/local/include/g++/std/bastring.h" 1 3
#pragma interface
# 1 "/usr/local/include/g++/cstddef" 1 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/stddef.h" 1 3 4
# 327 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/stddef.h" 3 4
# 6 "/usr/local/include/g++/cstddef" 2 3
# 35 "/usr/local/include/g++/std/bastring.h" 2 3
# 1 "/usr/local/include/g++/std/straits.h" 1 3
#pragma interface "std/straits.h"
extern "C++" {
template <class charT>
struct string_char_traits {
typedef charT char_type;
static void assign (char_type& c1, const char_type& c2)
{ c1 = c2; }
static bool eq (const char_type& c1, const char_type& c2)
{ return (c1 == c2); }
static bool ne (const char_type& c1, const char_type& c2)
{ return !(c1 == c2); }
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return char_type(); }
static bool is_del(char_type a) { return 0; }
static int compare (const char_type* s1, const char_type* s2, size_t n)
{
size_t i;
for (i = 0; i < n; ++i)
if (ne (s1[i], s2[i]))
return lt (s1[i], s2[i]) ? -1 : 1;
return 0;
}
static size_t length (const char_type* s)
{
size_t l = 0;
while (ne (*s++, eos ()))
++l;
return l;
}
static char_type* copy (char_type* s1, const char_type* s2, size_t n)
{
for (; n--; )
assign (s1[n], s2[n]);
return s1;
}
static char_type* move (char_type* s1, const char_type* s2, size_t n)
{
char_type a[n];
size_t i;
for (i = 0; i < n; ++i)
assign (a[i], s2[i]);
for (i = 0; i < n; ++i)
assign (s1[i], a[i]);
return s1;
}
static char_type* set (char_type* s1, const char_type& c, size_t n)
{
for (; n--; )
assign (s1[n], c);
return s1;
}
};
class istream;
class ostream;
# 1 "/usr/local/include/g++/cctype" 1 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/ctype.h" 1 3 4
extern char _ctype_[];
extern int tolower (int);
extern int toupper (int);
# 6 "/usr/local/include/g++/cctype" 2 3
# 105 "/usr/local/include/g++/std/straits.h" 2 3
# 1 "/usr/local/include/g++/cstring" 1 3
# 1 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/string.h" 1 3 4
# 1 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/sys/stdtypes.h" 1 3 4
typedef int sigset_t;
typedef unsigned int speed_t;
typedef unsigned long tcflag_t;
typedef unsigned char cc_t;
typedef int pid_t;
typedef unsigned short mode_t;
typedef short nlink_t;
typedef long clock_t;
typedef long time_t;
# 13 "/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.90.10/include/string.h" 2 3 4
extern char * strcat (char *, const char *) ;
extern char * strchr (const char *, int) ;
extern int strcmp (const char *, const char *) ;
extern char * strcpy (char *, const char *) ;
extern size_t strcspn (const char *, const char *) ;
extern char * strdup (const char *) ;
extern size_t strlen (const char *) ;
extern char * strncat (char *, const char *, long unsigned int ) ;
extern int strncmp (const char *, const char *, long unsigned int ) ;
extern char * strncpy (char *, const char *, long unsigned int ) ;
extern char * strpbrk (const char *, const char *) ;
extern char * strrchr (const char *, int) ;
extern size_t strspn (const char *, const char *) ;
extern char * strstr (const char *, const char *) ;
extern char * strtok (char *, const char *) ;
extern void * memchr (const void *, int, long unsigned int );
extern int memcmp (const void *, const void *, long unsigned int );
extern void * memcpy (void *, const void *, long unsigned int );
extern void * memmove (void *, const void *, long unsigned int );
extern void * memset (void *, int, long unsigned int );
extern int strcoll (const char *, const char *);
extern char * strerror (int);
extern long unsigned int strxfrm (char *, const char *, long unsigned int );
# 7 "/usr/local/include/g++/cstring" 2 3
# 94 "/usr/local/include/g++/cstring" 3
# 106 "/usr/local/include/g++/std/straits.h" 2 3
struct string_char_traits <char> {
typedef char char_type;
static void assign (char_type& c1, const char_type& c2)
{ c1 = c2; }
static bool eq (const char_type & c1, const char_type& c2)
{ return (c1 == c2); }
static bool ne (const char_type& c1, const char_type& c2)
{ return (c1 != c2); }
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return 0; }
static bool is_del(char_type a) { return ((_ctype_+1)[ a ]& 010 ) ; }
static int compare (const char_type* s1, const char_type* s2, size_t n)
{ return memcmp (s1, s2, n); }
static size_t length (const char_type* s)
{ return strlen (s); }
static char_type* copy (char_type* s1, const char_type* s2, size_t n)
{ return (char_type*) memcpy (s1, s2, n); }
static char_type* move (char_type* s1, const char_type* s2, size_t n)
{ return (char_type*) memmove (s1, s2, n); }
static char_type* set (char_type* s1, const char_type& c, size_t n)
{ return (char_type*) memset (s1, c, n); }
};
# 159 "/usr/local/include/g++/std/straits.h" 3
}
# 36 "/usr/local/include/g++/std/bastring.h" 2 3
# 46 "/usr/local/include/g++/std/bastring.h" 3
# 1 "/usr/local/include/g++/cassert" 1 3
# 1 "/usr/local/include/assert.h" 1 3
# 19 "/usr/local/include/assert.h" 3
extern "C" {
extern void __eprintf (const char *, const char *, unsigned, const char *);
}
# 50 "/usr/local/include/assert.h" 3
# 6 "/usr/local/include/g++/cassert" 2 3
# 48 "/usr/local/include/g++/std/bastring.h" 2 3
extern "C++" {
class istream; class ostream;
# 1 "/usr/local/include/g++/iterator" 1 3
# 57 "/usr/local/include/g++/std/bastring.h" 2 3
template <class charT, class traits = string_char_traits<charT> >
class basic_string
{
private:
struct Rep {
size_t len, res, ref;
bool selfish;
charT* data () { return reinterpret_cast<charT *>(this + 1); }
charT& operator[] (size_t s) { return data () [s]; }
charT* grab () { if (selfish) return clone (); ++ref; return data (); }
void release () { if (--ref == 0) delete this; }
inline static void * operator new (size_t, size_t);
inline static Rep* create (size_t);
charT* clone ();
inline void copy (size_t, const charT *, size_t);
inline void move (size_t, const charT *, size_t);
inline void set (size_t, const charT, size_t);
# 92 "/usr/local/include/g++/std/bastring.h" 3
inline static bool excess_slop (size_t, size_t);
inline static size_t frob_size (size_t);
private:
Rep &operator= (const Rep &);
};
public:
typedef traits traits_type;
typedef charT value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef charT& reference;
typedef const charT& const_reference;
typedef charT* pointer;
typedef const charT* const_pointer;
typedef pointer iterator;
typedef const_pointer const_iterator;
typedef ::reverse_iterator<iterator> reverse_iterator;
typedef ::reverse_iterator<const_iterator> const_reverse_iterator;
static const size_type npos = static_cast<size_type>(-1);
private:
Rep *rep () const { return reinterpret_cast<Rep *>(dat) - 1; }
void repup (Rep *p) { rep ()->release (); dat = p->data (); }
public:
const charT* data () const
{ return rep ()->data(); }
size_type length () const
{ return rep ()->len; }
size_type size () const
{ return rep ()->len; }
size_type capacity () const
{ return rep ()->res; }
size_type max_size () const
{ return (npos - 1)/sizeof (charT); }
bool empty () const
{ return size () == 0; }
basic_string& operator= (const basic_string& str)
{
if (&str != this) { rep ()->release (); dat = str.rep ()->grab (); }
return *this;
}
explicit basic_string (): dat (nilRep.grab ()) { }
basic_string (const basic_string& str): dat (str.rep ()->grab ()) { }
basic_string (const basic_string& str, size_type pos, size_type n = npos)
: dat (nilRep.grab ()) { assign (str, pos, n); }
basic_string (const charT* s, size_type n)
: dat (nilRep.grab ()) { assign (s, n); }
basic_string (const charT* s)
: dat (nilRep.grab ()) { assign (s); }
basic_string (size_type n, charT c)
: dat (nilRep.grab ()) { assign (n, c); }
basic_string(const_iterator begin, const_iterator end)
: dat (nilRep.grab ()) { assign (begin, end); }
~basic_string ()
{ rep ()->release (); }
void swap (basic_string &s) { charT *d = dat; dat = s.dat; s.dat = d; }
basic_string& append (const basic_string& str, size_type pos = 0,
size_type n = npos)
{ return replace (length (), 0, str, pos, n); }
basic_string& append (const charT* s, size_type n)
{ return replace (length (), 0, s, n); }
basic_string& append (const charT* s)
{ return append (s, traits::length (s)); }
basic_string& append (size_type n, charT c)
{ return replace (length (), 0, n, c); }
basic_string& append(const_iterator first, const_iterator last)
{ return replace (length (), 0, first, last - first); }
basic_string& assign (const basic_string& str, size_type pos = 0,
size_type n = npos)
{ return replace (0, npos, str, pos, n); }
basic_string& assign (const charT* s, size_type n)
{ return replace (0, npos, s, n); }
basic_string& assign (const charT* s)
{ return assign (s, traits::length (s)); }
basic_string& assign (size_type n, charT c)
{ return replace (0, npos, n, c); }
basic_string& assign(const_iterator first, const_iterator last)
{ return replace (0, npos, first, last - first); }
basic_string& operator= (const charT* s)
{ return assign (s); }
basic_string& operator= (charT c)
{ return assign (1, c); }
basic_string& operator+= (const basic_string& rhs)
{ return append (rhs); }
basic_string& operator+= (const charT* s)
{ return append (s); }
basic_string& operator+= (charT c)
{ return append (1, c); }
basic_string& insert (size_type pos1, const basic_string& str,
size_type pos2 = 0, size_type n = npos)
{ return replace (pos1, 0, str, pos2, n); }
basic_string& insert (size_type pos, const charT* s, size_type n)
{ return replace (pos, 0, s, n); }
basic_string& insert (size_type pos, const charT* s)
{ return insert (pos, s, traits::length (s)); }
basic_string& insert (size_type pos, size_type n, charT c)
{ return replace (pos, 0, n, c); }
iterator insert(iterator p, charT c)
{ 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 (); }
void insert(iterator p, const_iterator first, const_iterator last)
{ size_type pos = p - begin(); insert (pos, first, last - first); }
basic_string& remove (size_type pos = 0, size_type n = npos)
{ return replace (pos, n, (size_type)0, (charT)0); }
basic_string& remove (iterator pos)
{ return replace (pos - begin (), 1, (size_type)0, (charT)0); }
basic_string& remove (iterator first, iterator last)
{ return replace (first - begin (), last - first, (size_type)0, (charT)0);}
basic_string& replace (size_type pos1, size_type n1, const basic_string& str,
size_type pos2 = 0, size_type n2 = npos);
basic_string& replace (size_type pos, size_type n1, const charT* s,
size_type n2);
basic_string& replace (size_type pos, size_type n1, const charT* s)
{ return replace (pos, n1, s, traits::length (s)); }
basic_string& replace (size_type pos, size_type n1, size_type n2, charT c);
basic_string& replace (size_type pos, size_type n, charT c)
{ return replace (pos, n, 1, c); }
basic_string& replace (iterator i1, iterator i2, const basic_string& str)
{ return replace (i1 - begin (), i2 - i1, str); }
basic_string& replace (iterator i1, iterator i2, const charT* s, size_type n)
{ return replace (i1 - begin (), i2 - i1, s, n); }
basic_string& replace (iterator i1, iterator i2, const charT* s)
{ 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); }
basic_string& replace(iterator i1, iterator i2,
const_iterator j1, const_iterator j2)
{ return replace (i1, i2, j1, j2 - j1); }
private:
static charT eos () { return traits::eos (); }
void unique () { if (rep ()->ref > 1) alloc (capacity (), true); }
void selfish () { unique (); rep ()->selfish = true; }
public:
charT operator[] (size_type pos) const
{
if (pos == length ())
return eos ();
return data ()[pos];
}
reference operator[] (size_type pos)
{ unique (); return (*rep ())[pos]; }
reference at (size_type pos)
{
((void) (( !( pos >= length () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/usr/local/include/g++/std/bastring.h" , 285 , "!(pos >= length ())" ), 0) )) ;
return (*this)[pos];
}
const_reference at (size_type pos) const
{
((void) (( !( pos >= length () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/usr/local/include/g++/std/bastring.h" , 290 , "!(pos >= length ())" ), 0) )) ;
return data ()[pos];
}
private:
void terminate () const
{ traits::assign ((*rep ())[length ()], eos ()); }
public:
const charT* c_str () const
{ terminate (); return data (); }
void resize (size_type n, charT c);
void resize (size_type n)
{ resize (n, eos ()); }
void reserve (size_type) { }
size_type copy (charT* s, size_type n, size_type pos = 0);
size_type find (const basic_string& str, size_type pos = 0) const
{ return find (str.data(), pos, str.length()); }
size_type find (const charT* s, size_type pos, size_type n) const;
size_type find (const charT* s, size_type pos = 0) const
{ return find (s, pos, traits::length (s)); }
size_type find (charT c, size_type pos = 0) const;
size_type rfind (const basic_string& str, size_type pos = npos) const
{ return rfind (str.data(), pos, str.length()); }
size_type rfind (const charT* s, size_type pos, size_type n) const;
size_type rfind (const charT* s, size_type pos = npos) const
{ return rfind (s, pos, traits::length (s)); }
size_type rfind (charT c, size_type pos = npos) const;
size_type find_first_of (const basic_string& str, size_type pos = 0) const
{ return find_first_of (str.data(), pos, str.length()); }
size_type find_first_of (const charT* s, size_type pos, size_type n) const;
size_type find_first_of (const charT* s, size_type pos = 0) const
{ return find_first_of (s, pos, traits::length (s)); }
size_type find_first_of (charT c, size_type pos = 0) const
{ return find (c, pos); }
size_type find_last_of (const basic_string& str, size_type pos = npos) const
{ return find_last_of (str.data(), pos, str.length()); }
size_type find_last_of (const charT* s, size_type pos, size_type n) const;
size_type find_last_of (const charT* s, size_type pos = npos) const
{ return find_last_of (s, pos, traits::length (s)); }
size_type find_last_of (charT c, size_type pos = npos) const
{ return rfind (c, pos); }
size_type find_first_not_of (const basic_string& str, size_type pos = 0) const
{ return find_first_not_of (str.data(), pos, str.length()); }
size_type find_first_not_of (const charT* s, size_type pos, size_type n) const;
size_type find_first_not_of (const charT* s, size_type pos = 0) const
{ return find_first_not_of (s, pos, traits::length (s)); }
size_type find_first_not_of (charT c, size_type pos = 0) const;
size_type find_last_not_of (const basic_string& str, size_type pos = npos) const
{ return find_last_not_of (str.data(), pos, str.length()); }
size_type find_last_not_of (const charT* s, size_type pos, size_type n) const;
size_type find_last_not_of (const charT* s, size_type pos = npos) const
{ return find_last_not_of (s, pos, traits::length (s)); }
size_type find_last_not_of (charT c, size_type pos = npos) const;
basic_string substr (size_type pos = 0, size_type n = npos) const
{ return basic_string (*this, pos, n); }
int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const;
int compare (const charT* s, size_type pos, size_type n) const;
int compare (const charT* s, size_type pos = 0) const
{ return compare (s, pos, traits::length (s)); }
iterator begin () { selfish (); return &(*this)[0]; }
iterator end () { selfish (); return &(*this)[length ()]; }
const_iterator begin () const { return &(*rep ())[0]; }
const_iterator end () const { return &(*rep ())[length ()]; }
reverse_iterator rbegin() { return reverse_iterator (end ()); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator (end ()); }
reverse_iterator rend() { return reverse_iterator (begin ()); }
const_reverse_iterator rend() const
{ return const_reverse_iterator (begin ()); }
private:
void alloc (size_type size, bool save);
static size_type _find (const charT* ptr, charT c, size_type xpos, size_type len);
inline bool check_realloc (size_type s) const;
static Rep nilRep;
charT *dat;
};
template <class charT, class traits>
inline basic_string <charT, traits>
operator+ (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
basic_string <charT, traits> 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)
{
basic_string <charT, traits> 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)
{
basic_string <charT, traits> 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)
{
basic_string <charT, traits> 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)
{
basic_string <charT, traits> str (lhs);
str.append (1, rhs);
return str;
}
template <class charT, class traits>
inline bool
operator== (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) == 0);
}
template <class charT, class traits>
inline bool
operator== (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) == 0);
}
template <class charT, class traits>
inline bool
operator== (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) == 0);
}
template <class charT, class traits>
inline bool
operator!= (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) != 0);
}
template <class charT, class traits>
inline bool
operator!= (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) != 0);
}
template <class charT, class traits>
inline bool
operator< (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) < 0);
}
template <class charT, class traits>
inline bool
operator< (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) > 0);
}
template <class charT, class traits>
inline bool
operator< (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) < 0);
}
template <class charT, class traits>
inline bool
operator> (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) < 0);
}
template <class charT, class traits>
inline bool
operator> (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) > 0);
}
template <class charT, class traits>
inline bool
operator<= (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) >= 0);
}
template <class charT, class traits>
inline bool
operator<= (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) <= 0);
}
template <class charT, class traits>
inline bool
operator>= (const charT* lhs, const basic_string <charT, traits>& rhs)
{
return (rhs.compare (lhs) <= 0);
}
template <class charT, class traits>
inline bool
operator>= (const basic_string <charT, traits>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) >= 0);
}
template <class charT, class traits>
inline bool
operator!= (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) != 0);
}
template <class charT, class traits>
inline bool
operator> (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) > 0);
}
template <class charT, class traits>
inline bool
operator<= (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& rhs)
{
return (lhs.compare (rhs) <= 0);
}
template <class charT, class traits>
inline bool
operator>= (const basic_string <charT, traits>& lhs,
const basic_string <charT, traits>& 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');
}
# 6 "/usr/local/include/g++/string" 2 3
extern "C++" {
typedef basic_string <char> string;
}
# 3 "io1.cc" 2
ostream_iterator<string> oo(cout);
int main()
{
*oo = "Hello, ";
++oo;
*oo = "world!\n";
}
More information about the Gcc-bugs
mailing list