diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-05-31 14:14:42 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-05-31 14:14:42 +0000 |
commit | 1e2c0906eeaf6050034a17d06c9d40c16a3f29cd (patch) | |
tree | 7e03ee0ccbc4d0692ccc1eb272a0551cde8653f2 /libstdc++-v3/include/ext | |
parent | 877a19bfb8f34344702b206a549c61f7466fdf01 (diff) | |
download | gcc-1e2c0906eeaf6050034a17d06c9d40c16a3f29cd.zip gcc-1e2c0906eeaf6050034a17d06c9d40c16a3f29cd.tar.gz gcc-1e2c0906eeaf6050034a17d06c9d40c16a3f29cd.tar.bz2 |
basic_string.h (front, back): Add.
2010-05-31 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/basic_string.h (front, back): Add.
* include/debug/string: Adjust.
* include/ext/vstring.h (front, back): Tweak the implementation
to follow more closely the letter of the specs.
* testsuite/21_strings/basic_string/element_access/char/
front_back.cc: New.
* testsuite/21_strings/basic_string/element_access/wchar_t/
front_back.cc: Likewise.
* config/abi/pre/gnu.ver: Export new symbols.
* testsuite/util/testsuite_abi.cc: Adjust.
* configure.ac: Bump minor version to 6:15:0.
* configure: Regenerate.
From-SVN: r160071
Diffstat (limited to 'libstdc++-v3/include/ext')
-rw-r--r-- | libstdc++-v3/include/ext/vstring.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h index fc469cb..dffd35a 100644 --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -62,8 +62,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) typedef _Alloc allocator_type; typedef typename _CharT_alloc_type::size_type size_type; typedef typename _CharT_alloc_type::difference_type difference_type; - typedef typename _CharT_alloc_type::reference reference; - typedef typename _CharT_alloc_type::const_reference const_reference; + typedef value_type& reference; + typedef const value_type& const_reference; typedef typename _CharT_alloc_type::pointer pointer; typedef typename _CharT_alloc_type::const_pointer const_pointer; typedef __gnu_cxx::__normal_iterator<pointer, __versa_string> iterator; @@ -598,7 +598,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) */ reference front() - { return *begin(); } + { return operator[](0); } /** * Returns a read-only (constant) reference to the data at the first @@ -606,7 +606,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) */ const_reference front() const - { return *begin(); } + { return operator[](0); } /** * Returns a read/write reference to the data at the last @@ -614,7 +614,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) */ reference back() - { return *(end() - 1); } + { return operator[](this->size() - 1); } /** * Returns a read-only (constant) reference to the data at the @@ -622,7 +622,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) */ const_reference back() const - { return *(end() - 1); } + { return operator[](this->size() - 1); } #endif // Modifiers: |