diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-08-26 00:27:06 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-08-26 00:27:06 +0000 |
commit | 6162f5420c5e1072dd40aaf25d01441bc6346fa3 (patch) | |
tree | 4adf7075210bb48181d8f9024f795a49f80a75cb /libstdc++ | |
parent | 5a6db35fee5d2c0596f27356ef178f5e66284093 (diff) | |
download | gcc-6162f5420c5e1072dd40aaf25d01441bc6346fa3.tar.gz |
Mon Aug 25 14:26:45 1997 Jason Merrill <jason@yorick.cygnus.com>
* Makefile.in (CXXFLAGS): Add -Weffc++.
Sat Aug 23 21:25:37 1997 Mark Mitchell <mmitchell@usa.net>
* bastring.h: Enable reverse_iterator and its ilk.
* bastring.h: Provide specializations of member function templates
for const_iterator.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14922 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++')
-rw-r--r-- | libstdc++/ChangeLog | 11 | ||||
-rw-r--r-- | libstdc++/Makefile.in | 4 | ||||
-rw-r--r-- | libstdc++/std/bastring.h | 24 |
3 files changed, 31 insertions, 8 deletions
diff --git a/libstdc++/ChangeLog b/libstdc++/ChangeLog index 48eb5543a18..4eace634775 100644 --- a/libstdc++/ChangeLog +++ b/libstdc++/ChangeLog @@ -1,3 +1,14 @@ +Mon Aug 25 14:26:45 1997 Jason Merrill <jason@yorick.cygnus.com> + + * Makefile.in (CXXFLAGS): Add -Weffc++. + +Sat Aug 23 21:25:37 1997 Mark Mitchell <mmitchell@usa.net> + + * bastring.h: Enable reverse_iterator and its ilk. + + * bastring.h: Provide specializations of member function templates + for const_iterator. + Wed Jul 30 10:59:00 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com> * stlinst.cc: Add instantiation file for diff --git a/libstdc++/Makefile.in b/libstdc++/Makefile.in index 0858516fda5..79d8d88e500 100644 --- a/libstdc++/Makefile.in +++ b/libstdc++/Makefile.in @@ -53,7 +53,7 @@ MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist CLEAN_JUNK = $(LIBS) # Remove these for public releases. -CXXFLAGS = -g -O -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings +CXXFLAGS = -g -O -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -Weffc++ CFLAGS = -g -O -Wpointer-arith -Wnested-externs .PHONY: libs @@ -292,7 +292,7 @@ stuff: $(MAKE) clean $(MAKE) -C ../libio c++clean $(MAKE) -C ../libg++ clean - $(MAKE) check + $(MAKE) $(MAKEFLAGS) check $(MAKE) -C ../libio check $(MAKE) -C ../libg++ check diff --git a/libstdc++/std/bastring.h b/libstdc++/std/bastring.h index 5a2605bd050..98c7d44b688 100644 --- a/libstdc++/std/bastring.h +++ b/libstdc++/std/bastring.h @@ -54,7 +54,7 @@ extern "C++" { class istream; class ostream; -// #include <iterator.h> +#include <iterator> template <class charT, class traits = string_char_traits<charT> > class basic_string @@ -110,12 +110,10 @@ public: typedef const charT* const_pointer; typedef pointer iterator; typedef const_pointer const_iterator; -#if 0 typedef reverse_iterator<iterator, value_type, reference, difference_type> reverse_iterator; typedef reverse_iterator<const_iterator, value_type, const_reference, difference_type> const_reverse_iterator; -#endif static const size_type npos = static_cast<size_type>(-1); private: @@ -157,6 +155,9 @@ public: template<class InputIterator> basic_string(InputIterator begin, InputIterator end, Allocator& = Allocator()); +#else + basic_string(const_iterator begin, const_iterator end) + : dat (nilRep.grab ()) { assign (begin, end); } #endif ~basic_string () @@ -176,6 +177,9 @@ public: #if 0 template<class InputIterator> basic_string& append(InputIterator first, InputIterator last); +#else + basic_string& append(const_iterator first, const_iterator last) + { return replace (length (), 0, first, last - first); } #endif basic_string& assign (const basic_string& str, size_type pos = 0, @@ -190,6 +194,9 @@ public: #if 0 template<class InputIterator> basic_string& assign(InputIterator first, InputIterator last); +#else + basic_string& assign(const_iterator first, const_iterator last) + { return replace (0, npos, first, last - first); } #endif basic_string& operator= (const charT* s) @@ -220,6 +227,9 @@ public: #if 0 template<class InputIterator> void insert(iterator p, InputIterator first, InputIterator last); +#else + void insert(iterator p, const_iterator first, const_iterator last) + { size_type pos = p - begin(); insert (pos, first, last - first); } #endif basic_string& remove (size_type pos = 0, size_type n = npos) @@ -250,6 +260,10 @@ public: template<class InputIterator> basic_string& replace(iterator i1, iterator i2, InputIterator j1, InputIterator j2); +#else + basic_string& replace(iterator i1, iterator i2, + const_iterator j1, const_iterator j2) + { return replace (i1, i2, j1, j2 - j1); } #endif private: @@ -351,14 +365,12 @@ public: const_iterator begin () const { return &(*rep ())[0]; } const_iterator end () const { return &(*rep ())[length ()]; } -#if 0 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 ()); } -#endif + { return const_reverse_iterator (begin ()); } private: void alloc (size_type size, bool save); |