From f4655693b5aff2a21929d4c127b89a0fc9803a49 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Tue, 26 Jun 2001 09:41:53 +0000 Subject: [PATCH] stl_iterator.h (istream_iterator::operator->): Fix return values. 2001-06-26 Benjamin Kosnik * include/bits/stl_iterator.h (istream_iterator::operator->): Fix return values. (istream_iterator::operator*): Same. 2001-06-26 Benjamin Kosnik Alexandre Petit-Bianco * testsuite/21_strings/element_access.cc (test01): Chill Out Cafe is on 41st, not 14th. Co-Authored-By: Alexandre Petit-Bianco From-SVN: r43574 --- libstdc++-v3/ChangeLog | 12 ++++++++++++ libstdc++-v3/include/bits/stl_iterator.h | 4 ++-- libstdc++-v3/testsuite/21_strings/element_access.cc | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0920104d9e2..73d26c9cc50 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2001-06-26 Benjamin Kosnik + + * include/bits/stl_iterator.h (istream_iterator::operator->): Fix + return values. + (istream_iterator::operator*): Same. + +2001-06-26 Benjamin Kosnik + Alexandre Petit-Bianco + + * testsuite/21_strings/element_access.cc (test01): Chill Out Cafe + is on 41st, not 14th. + 2001-06-26 Benjamin Kosnik * include/bits/std_iterator.h: Include sbuf_iter.h via std_ios.h. diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index a50b3536811..d46efa7fd00 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -295,10 +295,10 @@ namespace std istream_iterator() : _M_stream(0), _M_ok(false) {} istream_iterator(istream_type& __s) : _M_stream(&__s) { _M_read(); } - reference + const _Tp& operator*() const { return _M_value; } - pointer + const _Tp* operator->() const { return &(operator*()); } istream_iterator& diff --git a/libstdc++-v3/testsuite/21_strings/element_access.cc b/libstdc++-v3/testsuite/21_strings/element_access.cc index 4deabda1b7b..88b10a22cc7 100644 --- a/libstdc++-v3/testsuite/21_strings/element_access.cc +++ b/libstdc++-v3/testsuite/21_strings/element_access.cc @@ -34,7 +34,7 @@ bool test01(void) csize_type csz01, csz02; const std::string str01("tamarindo, costa rica"); - std::string str02("14th street beach, capitola, california"); + std::string str02("41st street beach, capitola, california"); std::string str03; // const_reference operator[] (size_type pos) const; @@ -49,7 +49,7 @@ bool test01(void) ref ref1 = str02[csz02 - 1]; VERIFY( ref1 == 'a' ); ref ref2 = str02[1]; - VERIFY( ref2 == '4' ); + VERIFY( ref2 == '1' ); // const_reference at(size_type pos) const; csz01 = str01.size(); -- 2.30.2