aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2004-11-19 12:44:09 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2004-11-19 12:44:09 +0000
commitf4e5280b48245281bf49c197e307a38a8fc82705 (patch)
tree6f3ccc1459557652cc3b3de40980ec1433d49c70 /libstdc++-v3
parent9716416bf1d9d20ab10b1423a9f8e66c36c3c699 (diff)
downloadgcc-f4e5280b48245281bf49c197e307a38a8fc82705.zip
gcc-f4e5280b48245281bf49c197e307a38a8fc82705.tar.gz
gcc-f4e5280b48245281bf49c197e307a38a8fc82705.tar.bz2
[multiple changes]
2004-11-19 Chris Jefferson <chris@bubblescope.net> * include/bits/stl_list.h (list::back, list::back const): Don't decrement temporary. 2004-11-19 Paolo Carlini <pcarlini@suse.de> * include/bits/stl_deque.h (deque::front, deque::front const, deque::back, deque::back const): Slightly tweak for stylistic consistency. From-SVN: r90917
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog11
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h8
-rw-r--r--libstdc++-v3/include/bits/stl_list.h12
3 files changed, 25 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 638c420..5159a49 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,14 @@
+2004-11-19 Chris Jefferson <chris@bubblescope.net>
+
+ * include/bits/stl_list.h (list::back, list::back const):
+ Don't decrement temporary.
+
+2004-11-19 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/stl_deque.h (deque::front, deque::front const,
+ deque::back, deque::back const): Slightly tweak for stylistic
+ consistency.
+
2004-11-18 Paolo Carlini <pcarlini@suse.de>
* testsuite/26_numerics/numeric/sum_diff.cc: Use VERIFY.
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index 8b50fb5..b311438 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -970,7 +970,7 @@ namespace _GLIBCXX_STD
*/
reference
front()
- { return *this->_M_impl._M_start; }
+ { return *begin(); }
/**
* Returns a read-only (constant) reference to the data at the first
@@ -978,7 +978,7 @@ namespace _GLIBCXX_STD
*/
const_reference
front() const
- { return *this->_M_impl._M_start; }
+ { return *begin(); }
/**
* Returns a read/write reference to the data at the last element of the
@@ -987,7 +987,7 @@ namespace _GLIBCXX_STD
reference
back()
{
- iterator __tmp = this->_M_impl._M_finish;
+ iterator __tmp = end();
--__tmp;
return *__tmp;
}
@@ -999,7 +999,7 @@ namespace _GLIBCXX_STD
const_reference
back() const
{
- const_iterator __tmp = this->_M_impl._M_finish;
+ const_iterator __tmp = end();
--__tmp;
return *__tmp;
}
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 07185dd..ff6a0df 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -707,7 +707,11 @@ namespace _GLIBCXX_STD
*/
reference
back()
- { return *(--end()); }
+ {
+ iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
/**
* Returns a read-only (constant) reference to the data at the last
@@ -715,7 +719,11 @@ namespace _GLIBCXX_STD
*/
const_reference
back() const
- { return *(--end()); }
+ {
+ const_iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+ }
// [23.2.2.3] modifiers
/**